-
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
Silently allow --no-update for backward compatibility #10164
base: main
Are you sure you want to change the base?
Silently allow --no-update for backward compatibility #10164
Conversation
Reviewer's Guide by SourceryThis pull request introduces support for the '--no-update' flag to allow backward compatibility by silently allowing its usage. The changes ensure that when '--no-update' is provided with the lock command, the locked packages are not updated, and proper error handling has been added when both '--no-update' and '--regenerate' are used simultaneously. Test cases have been updated to verify the new behavior. Updated class diagram for LockCommand in LockCommand handlingclassDiagram
class LockCommand {
+List options
+handle() int
}
%% New option added for backward compatibility
class LockCommandOptions {
+"--no-update": boolean
+"--regenerate": boolean
}
LockCommand --> LockCommandOptions : uses
note for LockCommand "The '--no-update' option is added for backward compatibility. In handle(), if both '--no-update' and '--regenerate' are present, an error is displayed and returns 1."
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 @leonardgerardatomicmachinescom - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider using
pytest.mark.parametrize
to avoid repeating the same assertion logic intest_no_update_and_regenerate_at_the_same_time
.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 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.
881fa35
to
4a71826
Compare
4a71826
to
1ddc346
Compare
The error
The option "--no-update" does not exist
is not necessary since no update is anyway the default. Erroring does not help. Contrarily, it prevents scripts or automated uses to work with both v1 and v2.(I work in a place with shared build scripts, but users control which version of poetry they use, so when one installs poetry v2, it fails with the --no-update flag error).
Pull Request Check List
Resolves: #issue-number-here
Summary by Sourcery
Tests:
--no-update
flag and its incompatibility with the--regenerate
flag.