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

python: Enforce a stricted PyPI package naming policy #717

Closed
wants to merge 1 commit into from

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented Nov 22, 2024

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

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.
@mgorny
Copy link
Contributor Author

mgorny commented Nov 22, 2024

CC @ionenwks

Copy link
Member

@thesamesam thesamesam left a comment

Choose a reason for hiding this comment

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

s/stricted/stricter/

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.

4 participants