Ensure --dry-run option doesn't update poetry.lock for add, update and remove#5718
Merged
neersighted merged 3 commits intopython-poetry:masterfrom May 29, 2022
mkniewallner:fix-dry-run-option-add-update-remove
Merged
Ensure --dry-run option doesn't update poetry.lock for add, update and remove#5718neersighted merged 3 commits intopython-poetry:masterfrom mkniewallner:fix-dry-run-option-add-update-remove
--dry-run option doesn't update poetry.lock for add, update and remove#5718neersighted merged 3 commits intopython-poetry:masterfrom
mkniewallner:fix-dry-run-option-add-update-remove
Conversation
mkniewallner
commented
May 29, 2022
| def _write_lock_file(self, repo: Repository, force: bool = True) -> None: | ||
| if force or (self._update and self._write_lock): | ||
| def _write_lock_file(self, repo: Repository, force: bool = False) -> None: | ||
| if self._write_lock and (force or self._update): |
Member
Author
There was a problem hiding this comment.
This was a suggestion from @radoering here, and looking at the usage of the method, it does seem that the only place where we use force leaves _write_lock to True, so this seems to make sense.
mkniewallner
commented
May 29, 2022
| repo.add_package(get_package("docker", "4.3.1")) | ||
|
|
||
| tester.execute("cachy --dry-run") | ||
| tester.execute("cachy") |
Member
Author
There was a problem hiding this comment.
Updated the test here because since we're testing a keyboard interrupt, it may be nice to test that the non-dry-run variant prevents updates on the files.
neersighted
approved these changes
May 29, 2022
Closed
Merged
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Check List
Resolves: #3666
Resolves: #3766
Updated documentation for changed code.Not applicableUpdate logic of
_write_lock_fileto ensure that--dry-runoption ofadd,updateandremovecommands leavepoetry.lockintact.This supersedes #3767, since it has become stale, while adding missing tests for
--dry-runarguments on the commands.