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

Fix a bug where pip-sync would unexpectedly uninstall some packages #1919

Merged
merged 3 commits into from
Jul 18, 2023

Conversation

atugushev
Copy link
Member

@atugushev atugushev commented Jul 17, 2023

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).

@atugushev atugushev changed the title Fix a bug where pip-sync would uninstall packages some packages Fix a bug where pip-sync would uninstall some packages Jul 17, 2023
@atugushev atugushev marked this pull request as ready for review July 17, 2023 15:19
@@ -59,7 +60,7 @@ def dependency_tree(

while queue:
v = queue.popleft()
key = v.key
key = str(canonicalize_name(v.key))
Copy link
Member Author

@atugushev atugushev Jul 17, 2023

Choose a reason for hiding this comment

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

FTR: I'd prefer an explicit NormalizedName type instead of str conversion, so I'll refactor the types in a follow-up PR.

@atugushev atugushev requested a review from a team July 17, 2023 15:24
@atugushev atugushev changed the title Fix a bug where pip-sync would uninstall some packages Fix a bug where pip-sync would unexpectedly uninstall some packages Jul 17, 2023
@atugushev atugushev enabled auto-merge (squash) July 17, 2023 15:35
@atugushev atugushev added this to the 7.1.0 milestone Jul 17, 2023
@@ -59,7 +60,7 @@ def dependency_tree(

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have to worry about root_key and the installed_keys keys potentially being differently formatted at the time of the if root_key in installed_keys check?

Copy link
Member Author

Choose a reason for hiding this comment

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

Valid point. Thanks! This is why we should use NormalizedName type instead of str for package names. I'm going to address that in a follow-up PR as commented here.

@atugushev
Copy link
Member Author

Hey @jazzband/pip-tools! We seem to have encountered a bit of an issue with pip-sync that can be annoying. If anyone could kindly find the time to review the fix, I would greatly appreciate it. I would prepare a release soon. Thank you for your time and cooperation.

Copy link
Contributor

@AndydeCleyre AndydeCleyre left a comment

Choose a reason for hiding this comment

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

Thanks! Approving, with the understanding that a follow up PR will further iron out our name/key discrepancies.

@atugushev atugushev merged commit 6b162ac into jazzband:main Jul 18, 2023
@looztra
Copy link

looztra commented Jul 19, 2023

Thanks a lot for the quick fix!

@atugushev atugushev deleted the fix-broken-sync-diff branch July 20, 2023 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pip-sync 7.0.0 reinstalls packages due to case difference pip-sync 7.0.0 uninstalls pyproject-hooks
3 participants