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

repository: keep (uncanonicalized) pretty_name #6237

Merged
merged 2 commits into from
Aug 26, 2022

Conversation

radoering
Copy link
Member

Lockfiles created with 1.2rc1 are not compatible with 1.1 if there is a dependency with a dot in its name (e.g. discord.py), because 1.1 applies a half-hearted normalization not converting dot to dash (writing discord.py in the lockfile) and 1.2rc1 does a complete normalization so that discord.py is normalized to discord-py, which is written to the lockfile.

However, when looking at

"name": package.pretty_name,

we can see that the intention has always been to write pretty name (instead of the canonicalized name) into the lockfile. Considering that, half-hearted normalization vs. complete normalization is not the actual issue.

The actual issue is that pretty name got lost unintionally in the process of looking up dependencies in repositories. This PR ensures that pretty name is not lost anymore.

  • Added tests for changed code.
  • Updated documentation for changed code.

@dimbleby
Copy link
Contributor

interesting

canonicalization still creeps in for extras somewhere, I haven't tried to figure out where. Eg if you add pyjwt to a project you get these extras:

dev = ["coverage[toml] (==5.0.4)", "cryptography (>=3.3.1)", "mypy", "pre-commit", "pytest (>=6.0.0,<7.0.0)", "sphinx", "sphinx-rtd-theme", "zope-interface"]
docs = ["sphinx", "sphinx-rtd-theme", "zope-interface"]

although pyjwt declared a dependency on zope.interface (and that's what poetry 1.1 wrote in the lockfile)

neersighted
neersighted previously approved these changes Aug 25, 2022
Copy link
Member

@neersighted neersighted left a comment

Choose a reason for hiding this comment

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

I'm not the biggest fan of the inline canonicalization -- I'd rather see a variable to hold the canon form. That being said, LGTM even if you disagree.

src/poetry/packages/locker.py Outdated Show resolved Hide resolved
Copy link
Member

@neersighted neersighted left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants