Skip to content

Commit 41591f2

Browse files
webknjazajsanchezsanzmarkgreene74
committed
📦 Cap Cython under Python 3.12+ below v3.1
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 <3304408+ajsanchezsanz@users.noreply.github.com> Co-Authored-By: markgreene74 <18945890+markgreene74@users.noreply.github.com> Co-Authored-By: Sviatoslav Sydorenko
1 parent 0374761 commit 41591f2

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎packaging/pep517_backend/_backend.py‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from shutil import copytree
1111
from sys import implementation as _system_implementation
1212
from sys import stderr as _standard_error_stream
13-
from sys import version_info as _python_version_tuple
1413
from tempfile import TemporaryDirectory
1514
from warnings import warn as _warn_that
1615

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

82-
IS_PY3_12_PLUS = _python_version_tuple[:2] >= (3, 12)
83-
"""A flag meaning that the current runtime is Python 3.12 or higher."""
84-
8581
IS_CPYTHON = _system_implementation.name == "cpython"
8682
"""A flag meaning that the current interpreter implementation is CPython."""
8783

@@ -343,8 +339,8 @@ def get_requires_for_build_wheel(
343339
)
344340

345341
c_ext_build_deps = [] if is_pure_python_build else [
346-
'Cython >= 3.0.0b3' if IS_PY3_12_PLUS # Only Cython 3+ is compatible
347-
else 'Cython',
342+
'Cython ~= 3.0.0; python_version >= "3.12"',
343+
'Cython; python_version < "3.12"',
348344
]
349345

350346
return _setuptools_get_requires_for_build_wheel(

0 commit comments

Comments
 (0)