solver: fix special case where a direct origin dependency without extras ...#5770
Conversation
neersighted
left a comment
There was a problem hiding this comment.
I'd rather hold off merging this until we bump the core version -- could you rebase this onto poetry-core main in the mean time, and then once we bump core we can switch back?
| # TODO: remove https://github.com/python-poetry/poetry-core/pull/375 | ||
| dep._extras = frozenset(term.dependency.features) | ||
| positive_with_features = Term(dep, is_positive=True) | ||
| self._positive[term.dependency.complete_name] = positive_with_features |
There was a problem hiding this comment.
this doesn't look like a method that I would expect to be making updates to self: is there some other moment at which this should have happened?
There was a problem hiding this comment.
Maybe, you're right. I am not completely satisfied with the solution myself. Will take another look at it.
There was a problem hiding this comment.
Moved it to _register. Looks better, doesn't it?
There was a problem hiding this comment.
Yes, this looks a much better place for it - thanks!
suggestion: we only need to look for old_positive_without_features if the assignment dependency has features: else - which would usually be the case - we're just looking up the same thing twice. So
"""
name = assignment.dependency.complete_name
old_positive = self._positive.get(name)
- if old_positive is None:
+ if old_positive is None and assignment.dependency.features:
old_positive_without_features = self._positive.get(
assignment.dependency.name
)?
6b13028 to
b3e637e
Compare
|
I think you might have taken a wrong turn -- please elaborate if you think these issues are somehow related (and use a regular comment instead of a review comment, please). |
…ras is requested by the project and the same dependency with extras is requested by another dependency
b3e637e to
2ca6e08
Compare
Co-authored-by: Randy Döring <[email protected]>
Co-authored-by: Randy Döring <[email protected]>
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
… is requested by the project and the same dependency with extras is requested by another dependency
Pull Request Check List
Resolves: #5311