Skip to content

Commit

Permalink
📦 Cap Cython under Python 3.12+ below v3.1
Browse files Browse the repository at this point in the history
The effect of this is that the pre-release versions of Cython are no
longer allowed to be automatically installed into the ephemeral build
environment, implicitly.

Ref aio-libs/yarl#1411

Co-Authored-By: ajsanchezsanz <[email protected]>
Co-Authored-By: markgreene74 <[email protected]>
Co-Authored-By: Sviatoslav Sydorenko <[email protected]>
  • Loading branch information
4 people committed Nov 14, 2024
1 parent 0374761 commit 41591f2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packaging/pep517_backend/_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from shutil import copytree
from sys import implementation as _system_implementation
from sys import stderr as _standard_error_stream
from sys import version_info as _python_version_tuple
from tempfile import TemporaryDirectory
from warnings import warn as _warn_that

Expand Down Expand Up @@ -79,9 +78,6 @@
PURE_PYTHON_ENV_VAR = 'FROZENLIST_NO_EXTENSIONS'
"""Environment variable name toggle used to opt out of making C-exts."""

IS_PY3_12_PLUS = _python_version_tuple[:2] >= (3, 12)
"""A flag meaning that the current runtime is Python 3.12 or higher."""

IS_CPYTHON = _system_implementation.name == "cpython"
"""A flag meaning that the current interpreter implementation is CPython."""

Expand Down Expand Up @@ -343,8 +339,8 @@ def get_requires_for_build_wheel(
)

c_ext_build_deps = [] if is_pure_python_build else [
'Cython >= 3.0.0b3' if IS_PY3_12_PLUS # Only Cython 3+ is compatible
else 'Cython',
'Cython ~= 3.0.0; python_version >= "3.12"',
'Cython; python_version < "3.12"',
]

return _setuptools_get_requires_for_build_wheel(
Expand Down

0 comments on commit 41591f2

Please sign in to comment.