Skip to content

Commit

Permalink
do not depend on cffi for PyPy
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mgorny authored and tych0 committed May 25, 2024
1 parent 93b8830 commit b5c8daf
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b5c8daf

Please sign in to comment.