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

Ensure canonicalized requirement names are used as keys, to prevent unnecessary reinstallations during sync #1572

Merged
merged 2 commits into from Feb 7, 2022

Conversation

AndydeCleyre
Copy link
Contributor

@AndydeCleyre AndydeCleyre commented Feb 5, 2022

Fixes #1570

key_from_req did a limited normalization that did not include replacing dots with dashes.

Now that we're using pip's canonicalize_name elsewhere, which does replace dots, this created a divergence in representations of the same package, which led during sync to extra uninstallation and reinstallation of some packages incorrectly identified as different.

Contributor checklist
  • Provided the tests for the changes.
  • Assure PR title is short, clear, and good to be included in the user-oriented changelog
Maintainer checklist
  • Assure one of these labels is present: backwards incompatible, feature, enhancement, deprecation, bug, dependency, docs or skip-changelog as they determine changelog listing.
  • Assign the PR to an existing or new milestone for the target version (following Semantic Versioning).

Fixes jazzband#1570

Remove assert:
- assert doesn't belong in non-test code
- if key's not a str, canonicalize should fail
@AndydeCleyre AndydeCleyre changed the title Ensure consistent requirement names are used, to prevent unnecessary uninstallations during sync Ensure canonicalized requirement names are used as keys, to prevent unnecessary reinstallations during sync Feb 5, 2022
@AndydeCleyre AndydeCleyre marked this pull request as ready for review February 5, 2022 04:58
Copy link
Contributor

@di di left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Member

@atugushev atugushev left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@atugushev atugushev merged commit 553b665 into jazzband:master Feb 7, 2022
@atugushev atugushev added bug Something is not working sync labels Feb 7, 2022
@atugushev
Copy link
Member

Thanks @AndydeCleyre! I'll prepare a release shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[6.5.0] Packages needlessly uninstalled during sync due to non-canonicalized names (dots vs dashes)
3 participants