Fails to build on free-threaded Python 3.14
envgap__fonttools__py-zopfli-29
01 / FAILURE SIGNATURE
As reported upstream
ValueError: `py_limited_api='cp310'` not supported. `Py_LIMITED_API` is currently incompatible with `Py_GIL_DISABLED`. See https://github.com/python/cpython/issues/111506.
Not a benchmark task.
- The project already builds and runs before the fix, so there is nothing to repair.
02 / ENVIRONMENT RECIPE
- Base commit
fc5be48a165f21140bdfc457ef348b52ae7fcebb- Manifest
setup.py- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
fonttools/py-zopfli #29 · read the original issue
Currently, `pip install zopfli` fails on the free-threaded build with the following error:
```
File "/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-build-env-0pcm7yyo/overlay/lib/python3.14t/site-packages/setuptools/command/bdist_wheel.py", line 285, in _validate_py_limited_api
raise ValueError(
...<4 lines>...
)
ValueError: `py_limited_api='cp310'` not supported. `Py_LIMITED_API` is currently incompatible with `Py_GIL_DISABLED`. See https://github.com/python/cpython/issues/111506.
```
Python 3.15 will add a new `abi3t` stable ABI that is supported on the free-threaded build. I'm actively working on adding support for abi3t in setuptools (https://github.com/pypa/setuptools/issues/5205) so hopefully you'll be able to use that for Python 3.15 and newer.
For now though I think just adding some logic in `setup.py` to disable limited API builds on the free-threaded build will help a lot, since build errors are hard to work around. As a followup, adding official free-threaded support and uploading free-threaded wheels would also be great.
See [the free-threaded Python guide](https://py-free-threading.github.io) for more details about supporting the free-threaded build. I'm one of the primary authors and am happy to answer more questions.
Full install log:
<details>
```
goldbaum at Nathans-MacBook-Pro in ~/Documents/py-zopfli on fix-free-threaded-builds!
(.venv) ± pip install zopfli
Collecting zopfli
Using cached zopfli-0.4.1.tar.gz (179 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [81 lines of output]
/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-build-env-0pcm7yyo/overlay/lib/python3.14t/site-packages/setuptools/_distutils/dist.py:287: UserWarning: Unknown distribution option: 'test_suite'
warnings.warn(msg)
toml section missing PosixPath('pyproject.toml') does not contain any of the tool sections: ['setuptools_scm', 'vcs-versioning']
toml section missing PosixPath('pyproject.toml') does not contain any of the tool sections: ['setuptools_scm', 'vcs-versioning']
/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-build-env-0pcm7yyo/overlay/lib/python3.14t/site-packages/setuptools/dist.py:765: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!
********************************************************************************
Please consider removing the following classifiers in favor of a SPDX license expression:
License :: OSI Approved :: Apache Software License
See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
********************************************************************************
!!
self._finalize_license_expression()
running dist_info
creating /private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-modern-metadata-rekagfgr/zopfli.egg-info
writing /private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-modern-metadata-rekagfgr/zopfli.egg-info/PKG-INFO
writing dependency_links to /private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-modern-metadata-rekagfgr/zopfli.egg-info/dependency_links.txt
writing requirements to /private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-modern-metadata-rekagfgr/zopfli.egg-info/requires.txt
writing top-level names to /private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-modern-metadata-rekagfgr/zopfli.egg-info/top_level.txt
writing manifest file '/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-modern-metadata-rekagfgr/zopfli.egg-info/SOURCES.txt'
/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-build-env-0pcm7yyo/normal/lib/python3.14t/site-packages/vcs_versioning/overrides.py:609: UserWarning: No GlobalOverrides context is active. Auto-creating one with SETUPTOOLS_SCM prefix for backwards compatibility. Consider using 'with GlobalOverrides.from_env("YOUR_TOOL"):' explicitly.
return get_active_overrides().subprocess_timeout
listing git files failed - pretending there aren't any
reading manifest file '/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-modern-metadata-rekagfgr/zopfli.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'COPYING'
writing manifest file '/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-modern-metadata-rekagfgr/zopfli.egg-info/SOURCES.txt'
creating '/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-modern-metadata-rekagfgr/zopfli-0.4.1.dist-info'
Traceback (most recent call last):
File "/Users/goldbaum/Downloads/.venv/lib/python3.14t/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
main()
~~~~^^
File "/Users/goldbaum/Downloads/.venv/lib/python3.14t/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/Downloads/.venv/lib/python3.14t/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 175, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-build-env-0pcm7yyo/overlay/lib/python3.14t/site-packages/setuptools/build_meta.py", line 380, in prepare_metadata_for_build_wheel
self.run_setup()
~~~~~~~~~~~~~~^^
File "/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-build-env-0pcm7yyo/overlay/lib/python3.14t/site-packages/setuptools/build_meta.py", line 317, in run_setup
exec(code, locals())
~~~~^^^^^^^^^^^^^^^^
File "<string>", line 86, in <module>
File "/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-build-env-0pcm7yyo/overlay/lib/python3.14t/site-packages/setuptools/__init__.py", line 117, in setup
return distutils.core.setup(**attrs) # type: ignore[return-value]
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-build-env-0pcm7yyo/overlay/lib/python3.14t/site-packages/setuptools/_distutils/core.py", line 186, in setup
return run_commands(dist)
File "/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-build-env-0pcm7yyo/overlay/lib/python3.14t/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
dist.run_commands()
~~~~~~~~~~~~~~~~~^^
File "/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-build-env-0pcm7yyo/overlay/lib/python3.14t/site-packages/setuptools/_distutils/dist.py", line 1000, in run_commands
self.run_command(cmd)
~~~~~~~~~~~~~~~~^^^^^
File "/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-build-env-0pcm7yyo/overlay/lib/python3.14t/site-packages/setuptools/dist.py", line 1107, in run_command
super().run_command(command)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-build-env-0pcm7yyo/overlay/lib/python3.14t/site-packages/setuptools/_distutils/dist.py", line 1019, in run_command
cmd_obj.run()
~~~~~~~~~~~^^
File "/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-build-env-0pcm7yyo/overlay/lib/python3.14t/site-packages/setuptools/command/dist_info.py", line 99, in run
bdist_wheel = self.get_finalized_command('bdist_wheel')
File "/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-build-env-0pcm7yyo/overlay/lib/python3.14t/site-packages/setuptools/_distutils/cmd.py", line 318, in get_finalized_command
cmd_obj.ensure_finalized()
~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-build-env-0pcm7yyo/overlay/lib/python3.14t/site-packages/setuptools/_distutils/cmd.py", line 119, in ensure_finalized
self.finalize_options()
~~~~~~~~~~~~~~~~~~~~~^^
File "/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-build-env-0pcm7yyo/overlay/lib/python3.14t/site-packages/setuptools/command/bdist_wheel.py", line 250, in finalize_options
self._validate_py_limited_api()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/private/var/folders/1k/qnk13d854239ztdf9n4_f7n00000gn/T/pip-build-env-0pcm7yyo/overlay/lib/python3.14t/site-packages/setuptools/command/bdist_wheel.py", line 285, in _validate_py_limited_api
raise ValueError(
...<4 lines>...
)
ValueError: `py_limited_api='cp310'` not supported. `Py_LIMITED_API` is currently incompatible with `Py_GIL_DISABLED`. See https://github.com/python/cpython/issues/111506.
[end of output]
```
</details>04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]