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

Warn about potentially incompatible project name canonicalisations #560

Conversation

PeterJCLaw
Copy link
Contributor

@PeterJCLaw PeterJCLaw commented Mar 5, 2023

The handling of package names within the Python packaging ecosystem is unfortunately not in a great state at the moment. There exist a large number of packages which contain characters which (some of) the specs indicate are invalid, yet there is not a clear migration path nor destination at the moment.

Poetry's approach is to normalise project names towards their "canonical" form, meaning that existing projects on PyPI which use the more relaxed name forms will be silently renamed if they move to (recent versions of) Poetry. As well as changing the name of these packages (which maintainers are unlikely to expect nor desire) this unfortunately ends up breaking introspection via importlib.metadata in Python 3.8 and 3.9 which are not aware of the canonicalisation rules which Poetry is using.

Adding this warning informs maintainers so that they can decide how (and if) they want this name canonicalisation to happen.

  • Added tests for changed code.
    Not sure this is worthwhile here?

  • Updated documentation for changed code.
    Not planning to do this given the self-documenting nature of this.

Open to suggestions on better wording. Other details which might be worth including are:

Related to python-poetry/poetry#6198

PeterJCLaw and others added 2 commits March 5, 2023 14:08
The handling of package names within the Python packaging ecosystem
is unfortunately not in a great state at the moment. There exist
a large number of packages which contain characters which (some of)
the specs indicate are invalid, yet there is not a clear migration
path nor destination at the moment.

Poetry's approach is to normalise project names towards their
"canonical" form, meaning that existing projects on PyPI which
use the more relaxed name forms will be silently renamed if they
move to (recent versions of) Poetry. As well as changing the name
of these packages (which maintainers are unlikely to expect nor
desire) this unfortunately ends up breaking introspection via
`importlib.metadata` in Python 3.8 and 3.9 which are not aware of
the canonicalisation rules which Poetry is using.

Adding this warning informs maintainers so that they can decide
how (and if) they want this name canonicalisation to happen.
@sonarcloud
Copy link

sonarcloud bot commented Mar 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@dimbleby
Copy link
Contributor

dimbleby commented Aug 2, 2023

pypi/warehouse#10030 was closed - fixed apparently - a couple of weeks ago, which should make this unnecessary.

@Secrus
Copy link
Member

Secrus commented Aug 7, 2023

Closing as no longer necessary

@Secrus Secrus closed this Aug 7, 2023
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