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

clarify Provides-Dist example to match warehouse metadata validation #1586

Merged
merged 1 commit into from
Aug 18, 2024

Conversation

rjdbcm
Copy link
Contributor

@rjdbcm rjdbcm commented Aug 12, 2024

So I ran into the issue over of the weekend of getting 502s from PyPI on upload of one of my repos. After exhausting everything else I found out that using the format for Provides-Dist in the spec causes uploads to fail because warehouse uses packaging.requirements.Requirement to validate wheel METADATA. See pypi/warehouse#16452 It should also be noted that auditwheel and twine did not flag any problems with the wheel format and the only point of failure was a HTTP 502 from warehouse. It seemed in my judgement that editing the spec to keep people from running into this is a good idea. I defer to the PyPA team, though, it may be that warehouse needs changed instead as I am not privy to the original intent of the spec writers.

Thanks,
Eden Ross Duff


📚 Documentation preview 📚: https://python-packaging-user-guide--1586.org.readthedocs.build/en/1586/

Copy link
Member

@di di left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks right to me. PEP 566 says:

Version numbering requirements and the semantics for specifying comparisons between versions are defined in PEP 440.

The string 3.4 by itself is not a valid version specifier per PEP 440. Additionally:

Following PEP 508, version specifiers no longer need to be surrounded by parentheses in the fields Requires-Dist, Provides-Dist, Obsoletes-Dist or Requires-External, so e.g. requests >= 2.8.1 is now a valid value. The recommended format is without parentheses, but tools parsing metadata should also be able to handle version specifiers in parentheses.

Which means either of the following should be fine:

  • Provides-Dist: AnotherProject (==3.4)
  • Provides-Dist: AnotherProject==3.4

But the latter is preferred.

@chrysle chrysle added this pull request to the merge queue Aug 18, 2024
Merged via the queue into pypa:main with commit 41d1fee Aug 18, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

3 participants