-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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: update
, add
and remove
with --only
shall not uninstall dependencies from all other groups
#10014
fix: update
, add
and remove
with --only
shall not uninstall dependencies from all other groups
#10014
Conversation
…ependencies from all other groups Reintroduce some logic removed in bd3500d and add tests for it. Fix logic with `reresolve = False`, which had the same issue. - The change in installer is the fix for `reresolve = True` (reintroducing old logic). - The change in transaction is the fix for `reresolve = False`.
Reviewer's Guide by SourceryThis pull request fixes a bug where using the Sequence diagram for package installation with --only flagsequenceDiagram
participant User
participant Installer
participant Transaction
participant Repository
User->>Installer: Install with --only flag
Installer->>Transaction: calculate_operations(with_uninstalls)
alt reresolve=True
Transaction->>Repository: Get locked packages
Transaction->>Repository: Get lockfile packages
Transaction->>Transaction: Calculate uninstall ops
Transaction->>Transaction: Calculate install ops
Transaction-->>Installer: Return combined ops
else reresolve=False
Transaction->>Transaction: Check result packages
Transaction->>Transaction: Calculate ops for specified groups
Transaction-->>Installer: Return filtered ops
end
Installer-->>User: Execute operations
Class diagram for Transaction and Installer changesclassDiagram
class Transaction {
-_result_packages: List
-_current_packages: List
-_installed_packages: List
+calculate_operations(with_uninstalls: bool): List
}
class Installer {
-_requires_synchronization: bool
-_update: bool
-_extras: List
+_do_install(): int
}
class Operation {
+job_type: str
}
Transaction ..> Operation
Installer ..> Transaction
note for Transaction "Modified uninstall logic to respect --only flag"
note for Installer "Updated operation calculation based on reresolve flag"
Flow diagram for dependency resolution logicflowchart TD
A[Start Installation] --> B{Reresolve?}
B -->|Yes| C[Calculate operations]
C --> D[Get uninstall operations]
D --> E[Combine with install operations]
B -->|No| F[Calculate operations with filtered uninstalls]
E --> G[Execute operations]
F --> G
G --> H[End Installation]
subgraph Uninstall Logic
D
F
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @radoering - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Reintroduce some logic removed in bd3500d and add tests for it. Fix logic with
reresolve = False
, which had the same issue.reresolve = True
(reintroducing old logic).reresolve = False
.Pull Request Check List
Resolves: #9950
(Does not resolve the similar issue #9975. This one requires another fix.)
Summary by Sourcery
Restore the logic for the --only flag to prevent uninstalling dependencies from other groups, and add tests to cover this behavior.
Bug Fixes:
--only
flag withupdate
,add
, andremove
commands would uninstall dependencies from all other groups.Tests:
--only
flag behavior.