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

Check command doesn't recognize metadata 2.3 #1059

Closed
1 task done
konstin opened this issue Feb 27, 2024 · 8 comments
Closed
1 task done

Check command doesn't recognize metadata 2.3 #1059

konstin opened this issue Feb 27, 2024 · 8 comments

Comments

@konstin
Copy link

konstin commented Feb 27, 2024

Is there an existing issue for this?

  • 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?

2.3
Metadata

Please describe why your using this option

Pypi now supports uploading wheels with metadata 2.3 (pypi/warehouse#13606). I've added support for this in maturin (PyO3/maturin#1965) and successfully uploaded the wheel (METADATA in the pypi inspector), but twine check doesn't recognize metadata 2.3 yet:

$ twine check --strict test-crates/pyo3-mixed/target/wheels/pyo3_mixed-2.1.5-cp311-cp311-manylinux_2_34_x86_64.whl 
Checking test-crates/pyo3-mixed/target/wheels/pyo3_mixed-2.1.5-cp311-cp311-manylinux_2_34_x86_64.whl: ERROR    InvalidDistribution: Metadata is missing required fields: Name, Version.                                        
         Make sure the distribution includes the files where those fields are specified, and is using a supported        
         Metadata-Version: 1.0, 1.1, 1.2, 2.0, 2.1, 2.2.   

Anything else you'd like to mention?

No response

@sigmavirus24
Copy link
Member

This isn't working as we rely on pkginfo which doesn't appear to have this support https://bazaar.launchpad.net/~tseaver/pkginfo/trunk/view/head:/pkginfo/distribution.py https://bazaar.launchpad.net/~tseaver/pkginfo/trunk/revision/221

I'll see if I can get that added

@alex
Copy link
Member

alex commented Mar 4, 2024

pkginfo release is out which appears to have support

@sigmavirus24
Copy link
Member

@konstin a re-install will fix this for you as it should grab the new pkginfo since we don't cap that package at all.

@konstin
Copy link
Author

konstin commented Mar 4, 2024

Thanks, confirmed that this works.

@henryiii
Copy link

Does this still not mention 2.3 in the error message, even though 2.3 is now supported?

@sigmavirus24
Copy link
Member

sigmavirus24 commented Mar 17, 2024

Does this still not mention 2.3 in the error message, even though 2.3 is now supported?

I'm not sure what you're asking but if it's about the error posted above, that's generated by us from pkginfo https://github.com/pypa/twine/blob/main/twine%2Fpackage.py#L116-L123

            supported_metadata = list(pkginfo.distribution.HEADER_ATTRS)
            raise exceptions.InvalidDistribution(
                "Metadata is missing required fields: "
                f"{', '.join(missing_fields)}.\n"
                "Make sure the distribution includes the files where those fields "
                "are specified, and is using a supported Metadata-Version: "
                f"{', '.join(supported_metadata)}."
            )

@henryiii
Copy link

Ahh, perfect, the bug was that pkginfo wasn’t updated.

@umarbutler

This comment has been minimized.

tatiana added a commit to astronomer/astronomer-cosmos that referenced this issue May 2, 2024
tatiana added a commit to astronomer/astronomer-cosmos that referenced this issue May 7, 2024
tatiana added a commit to astronomer/astronomer-cosmos that referenced this issue May 10, 2024
tatiana added a commit to astronomer/astronomer-cosmos that referenced this issue May 10, 2024
tatiana added a commit to astronomer/astronomer-cosmos that referenced this issue May 13, 2024
tatiana added a commit to astronomer/astronomer-cosmos that referenced this issue May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants