Closed FeodorFitsner closed 4 months ago
See #1124
Would be helpful to have twine 5.1.0 yanked from pypi to prevent CI's relying on twine being broken, until bug gets fixed
Why does 5.0 work? Was the bug added to 5.1 just before importlib-metadata 8 was released? I was about to reply that it didn't have anything to do with 5.1 but checked it and it seems 5.0 works with importlib-metadata 8 (I assume).
I don't see the __init__.py
file even being touched: https://github.com/pypa/twine/compare/5.0.0...5.1.0. But the environment clearly does have importlib-metadata 8.0 and it works for me.
Ahh, I see it; it's due to the modernization of the build system, and the new build system doesn't set home-page
(it's triggering on twine itself!), but it happened to pass due to importlib-metadata returning None here instead of erroring before 8.0.
So yes, yanking 5.1 while waiting for 5.1.1 would be a temporary fix. You can also set !=5.1.0
in your CI's, like pipx run 'twine!=5.1.0'
.
This issue isn't due to a release of twine but due to a release of importlib-metadata 8
. See #977 where the deprecation warning was detected and reported.
Just bumped into this as well!
Same here!
Please yank the offending version - this is breaking all sorts of builds due to twine check
crashing.
Just ran into this. For those looking for a quick fix, I changed my twine dependency to twine!=5.1.0
, rebuilt my dev venv, and that worked for me.
Thanks @henryiii
This issue isn't due to a release of twine but due to a release of
importlib-metadata 8
.
I have to push back on this -- from a fresh py312 venv:
$ pip install 'twine<5.1'
Collecting twine<5.1
Using cached twine-5.0.0-py3-none-any.whl.metadata (3.3 kB)
...
Successfully installed Pygments-2.18.0 SecretStorage-3.3.3 certifi-2024.6.2 cffi-1.16.0 charset-normalizer-3.3.2 cryptography-42.0.8 docutils-0.21.2 idna-3.7 importlib-metadata-8.0.0 jaraco.classes-3.4.0 jaraco.context-5.3.0 jaraco.functools-4.0.1 jeepney-0.8.0 keyring-25.2.1 markdown-it-py-3.0.0 mdurl-0.1.2 more-itertools-10.3.0 nh3-0.2.17 pkginfo-1.11.1 pycparser-2.22 readme-renderer-43.0 requests-2.32.3 requests-toolbelt-1.0.0 rfc3986-2.0.0 rich-13.7.1 twine-5.0.0 urllib3-2.2.2 zipp-3.19.2
$ twine -h
usage: twine [-h] [--version] [--no-color] {check,upload,register}
...
i.e. even with importlib-metadata-8.0.0
, twine would still work, because the 5.0.0 package included the home-page
metadata twine itself is looking for. But if I upgrade it:
$ pip install -U 'twine'
Requirement already satisfied: twine in ./venv/lib/python3.12/site-packages (5.0.0)
Collecting twine
Using cached twine-5.1.0-py3-none-any.whl.metadata (3.4 kB)
Requirement already satisfied: pkginfo>=1.8.1 in ./venv/lib/python3.12/site-packages (from twine) (1.11.1)
Requirement already satisfied: readme-renderer>=35.0 in ./venv/lib/python3.12/site-packages (from twine) (43.0)
Requirement already satisfied: requests>=2.20 in ./venv/lib/python3.12/site-packages (from twine) (2.32.3)
Requirement already satisfied: requests-toolbelt!=0.9.0,>=0.8.0 in ./venv/lib/python3.12/site-packages (from twine) (1.0.0)
Requirement already satisfied: urllib3>=1.26.0 in ./venv/lib/python3.12/site-packages (from twine) (2.2.2)
Requirement already satisfied: importlib-metadata>=3.6 in ./venv/lib/python3.12/site-packages (from twine) (8.0.0)
Requirement already satisfied: keyring>=15.1 in ./venv/lib/python3.12/site-packages (from twine) (25.2.1)
Requirement already satisfied: rfc3986>=1.4.0 in ./venv/lib/python3.12/site-packages (from twine) (2.0.0)
Requirement already satisfied: rich>=12.0.0 in ./venv/lib/python3.12/site-packages (from twine) (13.7.1)
Requirement already satisfied: zipp>=0.5 in ./venv/lib/python3.12/site-packages (from importlib-metadata>=3.6->twine) (3.19.2)
Requirement already satisfied: jaraco.classes in ./venv/lib/python3.12/site-packages (from keyring>=15.1->twine) (3.4.0)
Requirement already satisfied: jaraco.functools in ./venv/lib/python3.12/site-packages (from keyring>=15.1->twine) (4.0.1)
Requirement already satisfied: jaraco.context in ./venv/lib/python3.12/site-packages (from keyring>=15.1->twine) (5.3.0)
Requirement already satisfied: SecretStorage>=3.2 in ./venv/lib/python3.12/site-packages (from keyring>=15.1->twine) (3.3.3)
Requirement already satisfied: jeepney>=0.4.2 in ./venv/lib/python3.12/site-packages (from keyring>=15.1->twine) (0.8.0)
Requirement already satisfied: nh3>=0.2.14 in ./venv/lib/python3.12/site-packages (from readme-renderer>=35.0->twine) (0.2.17)
Requirement already satisfied: docutils>=0.13.1 in ./venv/lib/python3.12/site-packages (from readme-renderer>=35.0->twine) (0.21.2)
Requirement already satisfied: Pygments>=2.5.1 in ./venv/lib/python3.12/site-packages (from readme-renderer>=35.0->twine) (2.18.0)
Requirement already satisfied: charset-normalizer<4,>=2 in ./venv/lib/python3.12/site-packages (from requests>=2.20->twine) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in ./venv/lib/python3.12/site-packages (from requests>=2.20->twine) (3.7)
Requirement already satisfied: certifi>=2017.4.17 in ./venv/lib/python3.12/site-packages (from requests>=2.20->twine) (2024.6.2)
Requirement already satisfied: markdown-it-py>=2.2.0 in ./venv/lib/python3.12/site-packages (from rich>=12.0.0->twine) (3.0.0)
Requirement already satisfied: mdurl~=0.1 in ./venv/lib/python3.12/site-packages (from markdown-it-py>=2.2.0->rich>=12.0.0->twine) (0.1.2)
Requirement already satisfied: cryptography>=2.0 in ./venv/lib/python3.12/site-packages (from SecretStorage>=3.2->keyring>=15.1->twine) (42.0.8)
Requirement already satisfied: more-itertools in ./venv/lib/python3.12/site-packages (from jaraco.classes->keyring>=15.1->twine) (10.3.0)
Requirement already satisfied: cffi>=1.12 in ./venv/lib/python3.12/site-packages (from cryptography>=2.0->SecretStorage>=3.2->keyring>=15.1->twine) (1.16.0)
Requirement already satisfied: pycparser in ./venv/lib/python3.12/site-packages (from cffi>=1.12->cryptography>=2.0->SecretStorage>=3.2->keyring>=15.1->twine) (2.22)
Using cached twine-5.1.0-py3-none-any.whl (38 kB)
Installing collected packages: twine
Attempting uninstall: twine
Found existing installation: twine 5.0.0
Uninstalling twine-5.0.0:
Successfully uninstalled twine-5.0.0
Successfully installed twine-5.1.0
$ twine -h
Traceback (most recent call last):
File ".../venv/bin/twine", line 5, in <module>
from twine.__main__ import main
File ".../venv/lib/python3.12/site-packages/twine/__init__.py", line 40, in <module>
__uri__ = metadata["home-page"]
~~~~~~~~^^^^^^^^^^^^^
File ".../venv/lib/python3.12/site-packages/importlib_metadata/_adapters.py", line 54, in __getitem__
raise KeyError(item)
KeyError: 'home-page'
5.1.0 stated relying on the fact that metadata["home-page"]
was returning None and producing a (hidden) deprecation warning. That's why installing 5.0.0 fixes it or installing importlib-metadata 7 fixes it.
Oh, that's good to know that only one version of twine is implicated. I've yanked it. That should stop the bleeding until the issue can be fixed.
Thank you, yanking solved it.
I can confirm this issue is with twine==4.0.2
too. It can be fixed by forcing importlib-metadata==7.2.1
installation.
Twine 5.1.1 was just released. I'm assuming this issue is addressed, but please don't hesitate to report if the issues aren't addressed.
Is there an existing issue for this?
What keywords did you use to search existing issues?
No response
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?
How did you install twine? Did you use your operating system's package manager or pip or something else?
What version of twine do you have installed (include the complete output)
Which package repository are you using?
pypi.org
Please describe the issue that you are experiencing
importlib_metadata
has just released 8.0.0 and CI jobs callingtwine upload
started failing with the following error:Please list the steps required to reproduce this behaviour
pip install --upgrade setuptools wheel twine poetry tomlkit virtualenv
Anything else you'd like to mention?
No response