Skip to content

Commit a4ebf20

Browse files
committed
📦 Depend on stable Cython in build backend
1 parent 041efe2 commit a4ebf20

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

packaging/pep517_backend/_backend.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from pathlib import Path
1212
from shutil import copytree
1313
from sys import stderr as _standard_error_stream
14-
from sys import version_info as _python_version_tuple
1514
from tempfile import TemporaryDirectory
1615

1716
from setuptools.build_meta import ( # noqa: F401
@@ -92,11 +91,6 @@
9291
Environment variable name toggle used to opt out of making C-exts.
9392
""" # noqa: WPS322, WPS428
9493

95-
IS_PY3_12_PLUS = _python_version_tuple[:2] >= (3, 12) # noqa: WPS462
96-
"""
97-
A flag meaning that the current runtime is Python 3.12 or higher.
98-
""" # noqa: WPS322 WPS428
99-
10094

10195
def _is_truthy_setting_value(setting_value: str) -> bool:
10296
truthy_values = {'', None, 'true', '1', 'on'}
@@ -333,8 +327,9 @@ def get_requires_for_build_wheel(
333327
334328
"""
335329
c_ext_build_deps = [
336-
'Cython >= 3.0.0b3' if IS_PY3_12_PLUS # Only Cython 3+ is compatible
337-
else 'Cython',
330+
'Cython >= 3.0.12; python_version >= "3.13"', # Ideally >= 3.1.0
331+
'Cython >= 3.0.0; python_version >= "3.12" and python_version < "3.13"',
332+
'Cython; python_version < "3.12"',
338333
]
339334

340335
return _setuptools_get_requires_for_build_wheel(

0 commit comments

Comments
 (0)