File tree Expand file tree Collapse file tree 4 files changed +17
-4
lines changed
Expand file tree Collapse file tree 4 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ jobs:
117117 pytest --numprocesses=auto --hypothesis-profile=${HYPOTHESIS_PROFILE} -v tests/
118118
119119 - name : Test CFFI Backend
120+ if : matrix.py != '3.13t'
120121 env :
121122 PYTHON_ZSTANDARD_IMPORT_POLICY : ' cffi'
122123 run : |
Original file line number Diff line number Diff line change 2929 - ' cp311-cp311'
3030 - ' cp312-cp312'
3131 - ' cp313-cp313'
32+ - ' cp313-cp313t'
3233 - ' cp314-cp314'
34+ - ' cp313-cp314t'
3335 exclude :
3436 - image : ' musllinux_1_1_aarch64'
3537 py : ' cp314-cp314'
Original file line number Diff line number Diff line change @@ -19,13 +19,17 @@ classifiers = [
1919 " Programming Language :: Python :: 3.12" ,
2020 " Programming Language :: Python :: 3.13" ,
2121 " Programming Language :: Python :: 3.14" ,
22+ " Programming Language :: Python :: Free Threading :: 1 - Unstable" ,
23+ " Programming Language :: Python :: Free Threading" ,
24+
2225]
2326keywords = [" zstandard" , " zstd" , " compression" ]
2427dependencies = []
2528
2629[project .optional-dependencies ]
2730cffi = [
28- ' cffi>=2.0.0b1 ; python_version >= "3.13" and platform_python_implementation != "PyPy"' ,
31+ " cffi~=1.17; platform_python_implementation != 'PyPy' and python_version < '3.14'" ,
32+ " cffi>=2.0.0b; platform_python_implementation != 'PyPy' and python_version >= '3.14'" ,
2933]
3034
3135[project .urls ]
@@ -34,7 +38,8 @@ Documentation = "https://python-zstandard.readthedocs.io/en/latest/"
3438
3539[build-system ]
3640requires = [
37- " cffi>=2.0.0b1 ; platform_python_implementation != 'PyPy'" ,
41+ " cffi~=1.17; platform_python_implementation != 'PyPy' and python_version < '3.14'" ,
42+ " cffi>=2.0.0b; platform_python_implementation != 'PyPy' and python_version >= '3.14'" ,
3843 " packaging" ,
3944 " setuptools" ,
4045]
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- # Require 2.0 for improved free-threading support
34- MINIMUM_CFFI_VERSION = "2.0"
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"
3536
3637ext_suffix = os .environ .get ("SETUPTOOLS_EXT_SUFFIX" )
3738if ext_suffix :
9091if platform .python_implementation () == "PyPy" :
9192 C_BACKEND = False
9293
94+ # cffi 2.0 only introduced no-GIL support for 3.14+.
95+ if platform .python_implementation () == "CPython" and sys .version_info [0 :2 ] == (3 , 13 ) and sysconfig .get_config_var ("Py_GIL_DISABLED" ):
96+ CFFI_BACKEND = False
97+
9398if "--legacy" in sys .argv :
9499 SUPPORT_LEGACY = True
95100 sys .argv .remove ("--legacy" )
You can’t perform that action at this time.
0 commit comments