Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed Sep 22, 2024
1 parent 9be05b4 commit 379f0f1
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/poetry/puzzle/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,14 @@ def _solve(self) -> tuple[list[Package], list[int]]:
if _package.name == dep.name:
continue

try:
index = _package.requires.index(dep)
except ValueError:
_package.add_dependency(dep)
else:
_dep = _package.requires[index]
if _dep.marker != dep.marker:
# marker of feature package is more accurate
# because it includes relevant extras
_dep.marker = dep.marker
# Avoid duplication.
if any(
_dep == dep and _dep.marker == dep.marker
for _dep in _package.requires
):
continue

_package.add_dependency(dep)
else:
final_packages.append(package)
depths.append(results[package])
Expand Down

0 comments on commit 379f0f1

Please sign in to comment.