Skip to content

Commit

Permalink
fix treatment of dependency via cache
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed Jun 25, 2022
1 parent d2733c8 commit 25e0ac6
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/poetry/puzzle/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,13 @@ def search_for_installed_packages(
return packages

def search_for_direct_origin_dependency(self, dependency: Dependency) -> Package:
cached = self._deferred_cache.get(dependency)
if cached is not None:
return cached
package = self._deferred_cache.get(dependency)
if package is not None:
pass

if dependency.is_vcs():
elif dependency.is_vcs():
dependency = cast(VCSDependency, dependency)
package = self._search_for_vcs(dependency)
dependency._source_reference = package.source_reference
dependency._source_resolved_reference = package.source_resolved_reference
dependency._source_subdirectory = package.source_subdirectory

elif dependency.is_file():
dependency = cast(FileDependency, dependency)
Expand All @@ -250,6 +247,11 @@ def search_for_direct_origin_dependency(self, dependency: Dependency) -> Package
f"Unknown direct dependency type {dependency.source_type}"
)

if dependency.is_vcs():
dependency._source_reference = package.source_reference
dependency._source_resolved_reference = package.source_resolved_reference
dependency._source_subdirectory = package.source_subdirectory

dependency._constraint = package.version
dependency._pretty_constraint = package.version.text

Expand Down

0 comments on commit 25e0ac6

Please sign in to comment.