Skip to content

Commit

Permalink
mixology: simplify term compatibility check
Browse files Browse the repository at this point in the history
  • Loading branch information
abn committed May 21, 2022
1 parent aa958ba commit b378d3e
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/poetry/mixology/term.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,21 +156,10 @@ def _is_direct_origin(dependency: Dependency) -> bool:
return dependency.source_type in ["directory", "file", "url", "git"]

def _compatible_dependency(self, other: Dependency) -> bool:
return (
return bool(
self.dependency.is_root
or other.is_root
or other.is_same_package_as(self.dependency)
or (
# we do this here to indicate direct origin dependencies are
# compatible with NVR dependencies
self.dependency.complete_name == other.complete_name
and self._is_direct_origin(self.dependency)
!= self._is_direct_origin(other)
and (
self.dependency.constraint.allows_all(other.constraint)
or other.constraint.allows_all(self.dependency.constraint)
)
)
or self.dependency.complete_name == other.complete_name
)

def _non_empty_term(
Expand Down

0 comments on commit b378d3e

Please sign in to comment.