From b5c8dafa4dc225f854af8b9592107176d4bddaa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Fri, 24 May 2024 20:25:19 +0200 Subject: [PATCH] do not depend on cffi for PyPy Make the dependency on `cffi` conditional to non-PyPy interpreters, in order to make the package installable on modern PyPy versions and ensure that the wheel metadata is static, irrespectively of which Python implementation is used to build it. The previous hack would attempt to install exactly the same `cffi` version that was used on PyPy which in the best case was redundant, and in the worst case made the package non-installable if PyPy used a non-public `cffi` version. Fixes #166 --- setup.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/setup.py b/setup.py index ce13702..04e76ef 100644 --- a/setup.py +++ b/setup.py @@ -43,15 +43,8 @@ def finalize_options(self): sys.exit(1) install.finalize_options(self) -# Check if we're running PyPy, cffi can't be updated -if '_cffi_backend' in sys.builtin_module_names: - import _cffi_backend - requires_cffi = "cffi==" + _cffi_backend.__version__ -else: - requires_cffi = "cffi>=1.1.0" - version = "1.5.0" -dependencies = [requires_cffi] +dependencies = ["cffi>=1.1.0; python_implementation != 'PyPy'"] setup( name="xcffib",