-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Ensure --dry-run
option doesn't update poetry.lock
for add
, update
and remove
#5718
Ensure --dry-run
option doesn't update poetry.lock
for add
, update
and remove
#5718
Conversation
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): |
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.
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.
|
||
tester.execute("cachy --dry-run") | ||
tester.execute("cachy") |
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.
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.
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. |
Pull Request Check List
Resolves: #3666
Resolves: #3766
Updated documentation for changed code.Not applicableUpdate logic of
_write_lock_file
to ensure that--dry-run
option ofadd
,update
andremove
commands leavepoetry.lock
intact.This supersedes #3767, since it has become stale, while adding missing tests for
--dry-run
arguments on the commands.