Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importlib metadata 8.0 causes unusual errors in startup for twine, others(?) #492

Closed
zzzeek opened this issue Jun 25, 2024 · 6 comments
Closed

Comments

@zzzeek
Copy link

zzzeek commented Jun 25, 2024

Using any python interpreter, here I use podman to run the "python" docker container to get a clean environment, install "twine". Then run from the command line. it fails. downgrade importlib-metadata<8.0, works again.

$ podman run -it  python bash
# pip install twine
# twine
Traceback (most recent call last):
  File "/usr/local/bin/twine", line 5, in <module>
    from twine.__main__ import main
  File "/usr/local/lib/python3.12/site-packages/twine/__init__.py", line 40, in <module>
    __uri__ = metadata["home-page"]
              ~~~~~~~~^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/importlib_metadata/_adapters.py", line 54, in __getitem__
    raise KeyError(item)
KeyError: 'home-page'

downgrade importlib-metadata:

# pip install "importlib_metadata<8.0"
Collecting importlib_metadata<8.0

error goes away:

# twine
usage: twine [-h] [--version] [--no-color] {upload,register,check}
twine: error: the following arguments are required: command, args

@otaviocv
Copy link

Just observed this issue.

@alex
Copy link
Member

alex commented Jun 25, 2024

Looks like this is because of #491

It seems like this was intentional and I guess twine should be updated for it.

@dhalbert
Copy link

dhalbert commented Jun 25, 2024

I am also here due to the incompatibility with twine. I'm a little confused about the versioning. https://pypi.org/project/importlib-metadata/ has 8.0.0, but the last github release showing here at this writing is 7.2.1. There is an 8.0.0 tag, though. I got here too late to see whether 8.0.0 ever existed as a github release, or whether it was deleted. But the pypi 8.0.0 isn't yanked.

@FFY00
Copy link
Member

FFY00 commented Jun 26, 2024

twine==5.1.0 seems to be yanked, so to reproduce the install command needs to be changed to pip install twine==5.1.0.

I was able to confirm the deprecation warnings were being issued, so it seems this should be fixed in twine.

$ PYTHONWARNINGS=always twine
/usr/local/lib/python3.12/site-packages/twine/__init__.py:40: DeprecationWarning: Implicit None on return values is deprecated and will raise KeyErrors.
  __uri__ = metadata["home-page"]
/usr/local/lib/python3.12/site-packages/twine/__init__.py:42: DeprecationWarning: Implicit None on return values is deprecated and will raise KeyErrors.
  __author__ = metadata["author"]
usage: twine [-h] [--version] [--no-color] {upload,check,register}
twine: error: the following arguments are required: command, args

I am also here due to the incompatibility with twine. I'm a little confused about the versioning. pypi.org/project/importlib-metadata has 8.0.0, but the last github release showing here at this writing is 7.2.1. There is an 8.0.0 tag, though. I got here too late to see whether 8.0.0 ever existed as a github release, or whether it was deleted. But the pypi 8.0.0 isn't yanked.

8.0.0 isn't listed on the readme yet because it hasn't be synchronized with the Python upstream, so there's no equivalent importlib.metadata version yet (it'll be 3.14, but not sure if will be synchronized with 8.0.0 or a newer release).

@dhalbert
Copy link

dhalbert commented Jun 26, 2024

twine yanked 5.1.0 and released 5.1.1 to fix this problem. Ref: pypa/twine#1125

@jaraco
Copy link
Member

jaraco commented Jun 27, 2024

Sorry for the disruption. Yes, the automated release of 8.0.0 failed due to the incompatibility with twine, which I was able to get fixed. I would have fixed it faster, but the twine review/release process is slow and requires two people and I was the only person actively working on it, and there was already outstanding breakage from unrelated issues blocking CI and automated releases. I was able to work around the release limitation coincidentally because there was already a 5.1.1 release drafted that I was able to amend.

I considered yanking importlib_metadata 8 also, but since the breakage was by design and the issue could be worked around by yanking a single version of the affected project, I chose that route instead.

The reason the github release is missing for the 8.0 tag is because the automated release process failed and I manually uploaded the release. I've created the github release now for consistency:

 importlib_metadata main @ git-id
f3901686ab
 importlib_metadata main @ .tox/release/bin/python -m jaraco.develop.create-github-release

@jaraco jaraco closed this as completed Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants