From 54b83d5e896601a7548e782a151bb84026e75054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Randy=20D=C3=B6ring?= <30527984+radoering@users.noreply.github.com> Date: Sun, 30 Oct 2022 14:24:11 +0100 Subject: [PATCH] add some comments --- src/poetry/installation/installer.py | 2 ++ tests/console/commands/test_lock.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/poetry/installation/installer.py b/src/poetry/installation/installer.py index 287a180a111..e3cdcb9e0ed 100644 --- a/src/poetry/installation/installer.py +++ b/src/poetry/installation/installer.py @@ -201,6 +201,8 @@ def _do_refresh(self) -> int: self._io, ) + # Always re-solve directory dependencies, otherwise we can't determine + # if anything has changed (and the lock file contains an invalid version). use_latest = [ p.name for p in locked_repository.packages if p.source_type == "directory" ] diff --git a/tests/console/commands/test_lock.py b/tests/console/commands/test_lock.py index 7f78a22ec67..a8ef7c2aac9 100644 --- a/tests/console/commands/test_lock.py +++ b/tests/console/commands/test_lock.py @@ -179,6 +179,12 @@ def test_lock_no_update_path_dependencies( poetry_with_nested_path_deps_old_lockfile: Poetry, repo: TestRepository, ): + """ + The lock file contains a variant of the directory dependency "quix" that does + not depend on "sampleproject". Although the version of "quix" has not been changed, + it should be re-solved because there is always only one valid version + of a directory dependency at any time. + """ repo.add_package(get_package("sampleproject", "1.3.1")) locker = Locker(