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

allow trailing comma in version_many #1550

Merged
merged 2 commits into from
Jun 26, 2024
Merged

Conversation

matt-phylum
Copy link
Contributor

@matt-phylum matt-phylum commented May 21, 2024

This PR makes a minor adjustment to the version_many grammar to allow a trailing comma to match the behavior of _parse_version_many.

Users may assume that setuptools install_requires is a comma separated list or otherwise leave trailing commas in dependency specifiers, leading to requirements like numpy >=1.19,. Since pypa/packaging#484 released in late 2022, the packaging package used by most packaging tools has been silently discarding trailing commas in version specifiers due to a slight misimplementation of a comma separated list. Because of this bug, users have created packages that do not conform to the spec yet work without issue.

More details about the behavior are on pypa/packaging#803 .

Even if everyone were using PEP 517 and had their build dependencies specified such that the version of the packaging package used in the build would be semver compatible (advisable but not recommended: setuptools setuptools hatch), the regression would still not be fixable in the packaging package because the same PEP 508 version specifiers are also used by PEP 518 when specifying the build backend. Packages authored since late 2022 may have these incorrect specifiers in their build-system.requires section and such packages would not be buildable by package managers with a fixed version of the packaging package.

This is important because tools like uv use alternative implementations of PEP 508. If 99% of users are using the packaging package's slightly broken implementation, the implementation becomes the de facto specification, and packages that comply to the de facto specification but not the documented specification become a problem for alternative implementations.


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

@chrysle
Copy link
Contributor

chrysle commented Jun 26, 2024

Could you rebase, please?

@chrysle chrysle enabled auto-merge June 26, 2024 13:04
@chrysle chrysle added this pull request to the merge queue Jun 26, 2024
Merged via the queue into pypa:main with commit 08c54d4 Jun 26, 2024
5 checks passed
@chrysle
Copy link
Contributor

chrysle commented Jun 26, 2024

Thanks!

@vegeta321311
Copy link

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