Skip to content

Commit e56f276

Browse files
committed
Re-add 3.13t in CI
* Split `cffi` depedency into two cases: 1.17 for versions up to 3.13, 2.0 for 3.14+ * Skip building cffi backend for 3.13t
1 parent f24ca7c commit e56f276

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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: |

.github/workflows/wheel.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ jobs:
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'

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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
]
2326
keywords = ["zstandard", "zstd", "compression"]
2427
dependencies = []
2528

2629
[project.optional-dependencies]
2730
cffi = [
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]
3640
requires = [
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
]

setup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import os
1111
import platform
1212
import sys
13+
import sysconfig
1314

1415
from setuptools import setup
1516

@@ -30,8 +31,8 @@
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

3637
ext_suffix = os.environ.get("SETUPTOOLS_EXT_SUFFIX")
3738
if ext_suffix:
@@ -90,6 +91,10 @@
9091
if 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+
9398
if "--legacy" in sys.argv:
9499
SUPPORT_LEGACY = True
95100
sys.argv.remove("--legacy")

0 commit comments

Comments
 (0)