Handling dependencies that don’t support free-threading#
Build dependencies that may need special consideration#
CFFI#
CFFI added support for the free-threaded build of Python 3.14 in version2.0.0. You can ensure it is installed by passing a version constraint to pip:
python-mpipinstallcffi>=2.0.0If you want to force CFFI 2.0.0 to be used as a dependency of a project, you can use the followingpyproject.toml snippet:
[build-system]requires=["cffi>=2.0.0",]You can also use thepython_versionenvironmentmarkerto specify the constraint is only valid for Python 3.14 and newer:
[build-system]requires=["cffi>=2.0.0; python_version >= '3.14'","cffi; python_version < '3.14'",]You can declare a runtime dependency in theproject.dependencies section usingthe same syntax.
CFFI does not support the free-threaded build of Python 3.13.
mypyc#
The mypyc bindings generatorhas preliminary support for the free-threadedbuild inthemain branch of mypyc. If you maintain a package that ships binaries usingmypyc, you should try building wheels using the development branch of mypyc. Themaintainers of mypyc encourage users to ship wheels this way and report issuesif they encounter any.
Usually mypyc is used with projects that can be straightforwardly used in apure-python mode. If there is no compiled build available, we suggest using apure-python build instead.
Other bindings generators#
Cython, nanobind, pybind11, and PyO3 all fully support the free-threadedbuild. See the documentation of those projects for more details about using themwith the free-threaded interpreter.
Runtime dependencies that don't support free-threading#
Depending on PyYAML#
PyYAML 6.0.3+ supports free-threaded Python starting with Python 3.14t+. If youmust support Python 3.13t, you can depend on thePyYAML-ft fork ofPyYAML.
Other Runtime Dependencies#
Zstandard#
Python 3.14 includes the newcompression.zstdmodule, backports are availableunderbackports.zstd for Python 3.9-3.13 and can replace thezstandard package.