pypa / twine

Utilities for interacting with PyPI
https://twine.readthedocs.io/
Apache License 2.0
1.59k stars 305 forks source link

check: Error message No METADATA in archive when it's there #1100

Closed jaraco closed 4 months ago

jaraco commented 4 months ago

Is there an existing issue for this?

What keywords did you use to search existing issues?

No Metadata in archive

What operating system are you using?

macOS

If you selected 'Other', describe your Operating System here

No response

What version of Python are you running?

3.12.3

How did you install twine? Did you use your operating system's package manager or pip or something else?

pipx install twine

What version of twine do you have installed (include the complete output)

5.0.0

Which package repository are you using?

pypi.org

Please describe the issue that you are experiencing

When running twine check on the attached wheel, it reports No METADATA in archive, even though it does have a METADATA file. Probably the issue is that the METADATA file is missing the requisite Metadata-Version field.

coherent_build-0.0.1.dev0-py3-none-any.whl.zip

Better would be to report an error message that indicates the true cause of the problem.

Please list the steps required to reproduce this behaviour

Build an invalid wheel without minimal metadata. Run twine check on it.

Anything else you'd like to mention?

No response

jaraco commented 4 months ago

pkginfo has the same issue.

sigmavirus24 commented 4 months ago

This needs to be fixed in pkginfo. I don't believe we can fix it ourselves

jaraco commented 4 months ago

The logic also exists in twine:

https://github.com/pypa/twine/blob/5d17a43dec622d6f4fc490937baad3db4b9a8e29/twine/wheel.py#L76-L85