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

lock: make --no-update the default behavior and introduce --regenerate for the previous default behavior #9327

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

radoering
Copy link
Member

Pull Request Check List

Resolves: #3248
Relates-to: #9136

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

⚠️ Breaking change. Requires a major version bump. ⚠️

The most difficult decision (if we want to let this change happen) is the name of the new option (old default behavior).

The old flag was --no-update. Why not call the new flag --update?

Because it's not exactly what it is. It does not update the locked package versions but ignores the lock file and creates a new one from scratch. The result is the same as an update because our (only) locking strategy is "use-latest" but in case we introduce alternative locking strategies in the future (cf #3527) the result will be different. Further, by not calling it --update the difference to poetry update --lock becomes clearer.

@rbebb
Copy link

rbebb commented Apr 24, 2024

I believe that it's the right move to switch the default behavior of poetry lock to poetry lock --no-update. More often than not, users are looking to update a few packages rather than all of them. If a user updates all of the packages, the user has an increased risk of introducing a package update that contains breaking changes.

This change will result in a more user friendly tool since the behavior will be more clear and therefore less experienced users will have less confusion!

@radoering radoering changed the title lock: make --no-update the default behavior and introduce --new for the previous default behavior lock: make --no-update the default behavior and introduce --regenerate for the previous default behavior Jul 27, 2024
@rbebb
Copy link

rbebb commented Jul 31, 2024

The proposed changes look good to me! Is it a good time to mark this draft as ready for review?

@radoering
Copy link
Member Author

This PR is marked as draft to avoid that it is merged by accident because we only want to do this with a major version bump and it is very likely but not absolutely clear that the next version will be 2.0. I will mark it as ready as soon as this is clarified. The actual review shoud be quite easy because this is a simple change.

@radoering radoering marked this pull request as ready for review September 15, 2024 14:31
@radoering radoering requested a review from a team September 15, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

breaking change: invert lock --no-update to lock --update (or similar)
3 participants