Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ dependencies = []

[project.optional-dependencies]
cffi = [
'cffi>=1.17 ; python_version >= "3.13" and platform_python_implementation != "PyPy"',
"cffi~=1.17; platform_python_implementation != 'PyPy' and python_version < '3.14'",
"cffi>=2.0.0b; platform_python_implementation != 'PyPy' and python_version >= '3.14'",
]

[project.urls]
Expand All @@ -34,7 +35,8 @@ Documentation = "https://python-zstandard.readthedocs.io/en/latest/"

[build-system]
requires = [
"cffi>=1.17.0 ; platform_python_implementation != 'PyPy'",
"cffi~=1.17; platform_python_implementation != 'PyPy' and python_version < '3.14'",
"cffi>=2.0.0b; platform_python_implementation != 'PyPy' and python_version >= '3.14'",
"packaging",
"setuptools",
]
Expand Down
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import os
import platform
import sys
import sysconfig

from setuptools import setup

Expand All @@ -30,7 +31,8 @@
# garbage collection pitfalls.
# Require 1.17 everywhere so we don't have to think about supporting older
# versions.
MINIMUM_CFFI_VERSION = "1.17"
# Require 2.0 when building with 3.14+ for improved free-threading support
MINIMUM_CFFI_VERSION = "2.0" if sys.version_info[0:2] >= (3, 14) else "1.17"

ext_suffix = os.environ.get("SETUPTOOLS_EXT_SUFFIX")
if ext_suffix:
Expand Down Expand Up @@ -89,6 +91,10 @@
if platform.python_implementation() == "PyPy":
C_BACKEND = False

# cffi only supports no-GIL with Python 3.14+
if platform.python_implementation() == "CPython" and sys.version_info[0:2] == (3, 13) and sysconfig.get_config_var("Py_GIL_DISABLED"):
CFFI_BACKEND = False

if "--legacy" in sys.argv:
SUPPORT_LEGACY = True
sys.argv.remove("--legacy")
Expand Down
Loading
Loading