From 3612070f4b9ff6dc12dead08763fb1afc54924b0 Mon Sep 17 00:00:00 2001 From: Maxim Koltsov Date: Sat, 3 Sep 2022 21:21:41 +0300 Subject: [PATCH] Do not fetch VCS deps when reference didn't change --- src/poetry/puzzle/provider.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/poetry/puzzle/provider.py b/src/poetry/puzzle/provider.py index 523228c9e88..516b6990afc 100644 --- a/src/poetry/puzzle/provider.py +++ b/src/poetry/puzzle/provider.py @@ -581,6 +581,12 @@ def complete_package( # Retrieving constraints for deferred dependencies for r in requires: if r.is_direct_origin(): + locked = self.get_locked(r) + # If lock file contains exactly the same URL and reference + # (commit hash) of dependency as is requested, + # do not analyze it again: nothing could have changed. + if locked is not None and locked.package.is_same_package_as(r): + continue self.search_for_direct_origin_dependency(r) optional_dependencies = []