diff --git a/src/poetry/mixology/partial_solution.py b/src/poetry/mixology/partial_solution.py index 0e7bccb95bf..3acb92ff78c 100644 --- a/src/poetry/mixology/partial_solution.py +++ b/src/poetry/mixology/partial_solution.py @@ -146,6 +146,15 @@ def _register(self, assignment: Assignment) -> None: """ name = assignment.dependency.complete_name old_positive = self._positive.get(name) + if old_positive is None and assignment.dependency.features: + old_positive_without_features = self._positive.get( + assignment.dependency.name + ) + if old_positive_without_features is not None: + dep = old_positive_without_features.dependency.with_features( + assignment.dependency.features + ) + old_positive = Term(dep, is_positive=True) if old_positive is not None: value = old_positive.intersect(assignment) assert value is not None @@ -213,13 +222,6 @@ def relation(self, term: Term) -> str: if positive is not None: return positive.relation(term) - positive = self._positive.get(term.dependency.name) - if positive is not None: - dep = positive.dependency.with_features(term.dependency.features) - positive_with_features = Term(dep, is_positive=True) - self._positive[term.dependency.complete_name] = positive_with_features - return positive_with_features.relation(term) - by_ref = self._negative.get(term.dependency.complete_name) if by_ref is None: return SetRelation.OVERLAPPING