File tree Expand file tree Collapse file tree 4 files changed +131
-8
lines changed
Expand file tree Collapse file tree 4 files changed +131
-8
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ Version History
1212 This fixes a nogil / multi-threaded compile error. (#201, #275)
1313* A zstandard commit to fix qsort detection on BSD operating systems
1414 has been backported. (#272)
15+ * We now require cffi >= 2.0.0b on Python 3.14. <3.14 still requires 1.17.
16+ (#274)
17+ * The cffi backend is now automatically disabled for nogil builds on Python
18+ <3.14, as cffi didn't implement nogil support until the 2.0 release. (#274)
1519
16200.24.0 (released 2025-08-17)
1721============================
Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ dependencies = []
2525
2626[project .optional-dependencies ]
2727cffi = [
28- ' cffi>=1.17 ; python_version >= "3.13" and platform_python_implementation != "PyPy"' ,
28+ " cffi~=1.17; platform_python_implementation != 'PyPy' and python_version < '3.14'" ,
29+ " cffi>=2.0.0b; platform_python_implementation != 'PyPy' and python_version >= '3.14'" ,
2930]
3031
3132[project .urls ]
@@ -34,7 +35,8 @@ Documentation = "https://python-zstandard.readthedocs.io/en/latest/"
3435
3536[build-system ]
3637requires = [
37- " cffi>=1.17.0 ; platform_python_implementation != 'PyPy'" ,
38+ " cffi~=1.17; platform_python_implementation != 'PyPy' and python_version < '3.14'" ,
39+ " cffi>=2.0.0b; platform_python_implementation != 'PyPy' and python_version >= '3.14'" ,
3840 " packaging" ,
3941 " setuptools" ,
4042]
Original file line number Diff line number Diff line change 1010import os
1111import platform
1212import sys
13+ import sysconfig
1314
1415from setuptools import setup
1516
3031# garbage collection pitfalls.
3132# Require 1.17 everywhere so we don't have to think about supporting older
3233# versions.
33- MINIMUM_CFFI_VERSION = "1.17"
34+ # Require 2.0 for Python 3.14+ to add improved free-threading support
35+ MINIMUM_CFFI_VERSION = "2.0" if sys .version_info [0 :2 ] >= (3 , 14 ) else "1.17"
3436
3537ext_suffix = os .environ .get ("SETUPTOOLS_EXT_SUFFIX" )
3638if ext_suffix :
8991if platform .python_implementation () == "PyPy" :
9092 C_BACKEND = False
9193
94+ # cffi 2.0 only introduced no-GIL support for 3.14+.
95+ if sys .version_info [0 :2 ] < (3 , 14 ) and sysconfig .get_config_var (
96+ "Py_GIL_DISABLED"
97+ ):
98+ print (
99+ "cffi backend requires 3.14+ for nogil Python; disabling cffi" ,
100+ file = sys .stderr ,
101+ )
102+ CFFI_BACKEND = False
103+
92104if "--legacy" in sys .argv :
93105 SUPPORT_LEGACY = True
94106 sys .argv .remove ("--legacy" )
You can’t perform that action at this time.
0 commit comments