Twine does not install with Python 3.13t
Is there an existing issue for this?
- [x] I have searched the existing issues (open and closed), and could not find an existing issue
What keywords did you use to search existing issues?
gil freethreading
What operating system are you using?
Linux
If you selected 'Other', describe your Operating System here
No response
What version of Python are you running?
$ python3.13t --version
Python 3.13.2
How did you install twine? Did you use your operating system's package manager or pip or something else?
python3.13t -m venv venv
venv/bin/pip install twine==6.1.0
# ...
# ERROR: Failed building wheel for cryptographyFailed to build cryptography
# ERROR: Failed to build installable wheels for some pyproject.toml based projects (cryptography)
What version of twine do you have installed (include the complete output)
The installation of twine 6.1.0 failed, I cannot run `twine --version`.
Which package repository are you using?
pypi.org
Please describe the issue that you are experiencing
I cannot install twine on Python 3.13t freethreaded.
Please list the steps required to reproduce this behaviour
- attempt to install twine in a Python 3.13t venv.
- see that it fails.
Anything else you'd like to mention?
No response
The pip error is quite self explanatory: pip failed to install cryptography which is a transitive dependency of twine. The reason for that is that cryptography does not distribute wheels for the free threading version of Python and that compiling it requires a complex toolchain that it is likely not installed on your system. In any way, this is not a twine issue.
The pip error is quite self explanatory: pip failed to install cryptography which is a transitive dependency of twine. The reason for that is that cryptography does not distribute wheels for the free threading version of Python and that compiling it requires a complex toolchain that it is likely not installed on your system. In any way, this is not a twine issue.
Yes and no? The compatibility issue is not in twine, obviously, but it is an issue for twine not to run on the freethreading version?
Twine runs on free threaded python just fine, if its install dependencies are satisfied. Install dependencies are a prerequisite to running twine. The installation of these dependencies is outside the control of twine or its developers. In other words, how do you suggest the twine developers solve the fact that a wheel for cryptography package is not available for your platform?
@dnicolodi is right that this is blocked on upstream changes: in particular, cryptography is tracking with https://github.com/pyca/cryptography/issues/11702, and they themselves are blocked pending upstream changes to PyO3.
However, IMO it's completely fair for @zx80 to have raised an issue here: while it isn't our defect technically, it manifests in a way that causes problem for users of twine. So IMO it's perfectly fine to leave an issue open here, at the very least so that we can pin it and redirect other users who experience the same problem.
So thanks @zx80, I appreciate the report! It's unfortunately blocked for now, but I'll pin this so that other users don't have to work it out from scratch.
Triage: our upstream blocker is now resolved. I'd definitely appreciate more user reports of success/failure now that that's resolved.
(Closing this for now, we can track with a new issue since any new failure will probably be outside of that dep.)