python: Enforce a stricted PyPI package naming policy #717
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enforce a stricter package naming policy that requires using lowercase names and hyphens over underscores. Once this change lands, I'll update the Python Guide as well.
Previously, the policy was to permit either forcing lowercase, or to follow upstream naming (and the name check, more liberally, was done case-insensitively), with a note to enforce consistency across different packages. This caused twofold problems.
Firstly, not all packages ended up following the policy for consistent naming -- so we e.g. have flit-core but flit_scm, or flask but Frozen-Flask. Part of the problem is that 1) PyPI packages themselves, particularly third-party extensions, don't follow consistent naming themselves, and 2) some PyPI packages actually get "renamed" with case and/or hyphen changes.
Secondly, this policy makes naming less predictable. In particular, with upstream name of "flit-scm", you don't immediately figure out it's "flit_scm" in Gentoo, or with "PyGithub" you can't guess whether to look for "PyGithub" or "pygithub".
The changed policy will require changes to 44 packages in Gentoo.
CC @gentoo/python