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

Can't run a twine upload due to version problem #15611

Closed
luriol opened this issue Mar 16, 2024 · 8 comments
Closed

Can't run a twine upload due to version problem #15611

luriol opened this issue Mar 16, 2024 · 8 comments
Labels
bug 🐛 requires triaging maintainers need to do initial inspection of issue

Comments

@luriol
Copy link

luriol commented Mar 16, 2024

I'm trying to upload a distrubtion of a package to pypy using python3 -m twine upload dist/.16

I get an error saying
"
InvalidDistribution: Metadata is missing required fields: Name, Version.
"
If I unpack the whl file and look at the METADATA file I notice that an exact older version which uploaded correctly had the line

Metadata-Version: 2.1

When I currently try to build the package it won't upload (and also fails a twine check). When I look at the METADATA from the newer version is says

Metadata-Version: 2.3

If I simply change 2.3 to 2.1 I can rezip the whl package and it now passes the twine check and everything is fine.

How can I fix this?

@luriol luriol added bug 🐛 requires triaging maintainers need to do initial inspection of issue labels Mar 16, 2024
@di
Copy link
Member

di commented Mar 17, 2024

Hi, are you using the latest version of twine?

@stecohen
Copy link

stecohen commented Mar 17, 2024

I have the same issue - updating to the latest version of twine (5.0.0) did not help

@di
Copy link
Member

di commented Mar 17, 2024

Are you using the latest version of twine?

@stecohen
Copy link

Yes, as per my initial post

@stecohen
Copy link

I had to downgrade python from 3.11.7 to 3.10.10 to fix this issue

@umarbutler
Copy link

umarbutler commented Mar 18, 2024

On 15 March, I updated a package using py -m twine upload --repository pypi dist/* and experienced no issues. Today, I built a new package, seemingly having not upgraded any of my build tools (although perhaps it is possible I did?) and experienced this issue: InvalidDistribution: Metadata is missing required fields: Name, Version.. This persisted even after upgrading my twine and trying Python 11 instead of 12. Only after upgrading pkginfo was the issue fixed. A higher version of pkginfo should be a requirement to ensure that this doesn't happen to others. At the very least, twine's error message should mentioned that upgrading pkginfo will probably solve the issue.

Related issues I have located are as follows:

@LightOfHeaven1994
Copy link

@umarbutler thanks a lot, bumping pkginfo helped us to resolve the issue ❤️

@luriol luriol closed this as completed Mar 18, 2024
@LtStarbuck1030
Copy link

On 15 March, I updated a package using py -m twine upload --repository pypi dist/* and experienced no issues. Today, I built a new package, seemingly having not upgraded any of my build tools (although perhaps it is possible I did?) and experienced this issue: InvalidDistribution: Metadata is missing required fields: Name, Version.. This persisted even after upgrading my twine and trying Python 11 instead of 12. Only after upgrading pkginfo was the issue fixed. A higher version of pkginfo should be a requirement to ensure that this doesn't happen to others. At the very least, twine's error message should mentioned that upgrading pkginfo will probably solve the issue.

Related issues I have located are as follows:

* [Check command doesn't recognize metadata 2.3 pypa/twine#1059](https://github.com/pypa/twine/issues/1059)

* [Can't run a twine upload due to version problem #15611](https://github.com/pypi/warehouse/issues/15611)

* [Twine should require pkginfo > 1.10 pypa/twine#1070](https://github.com/pypa/twine/issues/1070)

* [Successfully build *.whl and *.tar.gz, but cannot upload them through twine pypa/packaging-problems#735](https://github.com/pypa/packaging-problems/issues/735)

This worked perfectly. Ashamed of how long it took me to stumble on this response. Thank you <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 requires triaging maintainers need to do initial inspection of issue
Projects
None yet
Development

No branches or pull requests

6 participants