Skip to content

Commit

Permalink
Do not consider constrants when checking for equality of direct origi…
Browse files Browse the repository at this point in the history
…n dependencies
  • Loading branch information
Jinior committed Jun 27, 2022
1 parent cc8c659 commit d4d8727
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/poetry/core/packages/dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,9 @@ def __eq__(self, other: object) -> bool:
if not isinstance(other, Dependency):
return NotImplemented

return super().__eq__(other) and self._constraint == other.constraint
return super().__eq__(other) and (
self._constraint == other.constraint or self.is_direct_origin()
)

def __hash__(self) -> int:
# don't include _constraint in hash because it is mutable!
Expand Down

0 comments on commit d4d8727

Please sign in to comment.