-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New Resolver: Add support for direct URLs with extras #8291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
775f9ff
95347df
9506a28
901898c
24e4cf7
50c9ea2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,12 +180,16 @@ def make_requirement_from_install_req(self, ireq): | |
# TODO: Get name and version from ireq, if possible? | ||
# Specifically, this might be needed in "name @ URL" | ||
# syntax - need to check where that syntax is handled. | ||
cand = self._make_candidate_from_link( | ||
candidate = self._make_candidate_from_link( | ||
ireq.link, extras=set(ireq.extras), parent=ireq, | ||
) | ||
return ExplicitRequirement(cand) | ||
return self.make_requirement_from_candidate(candidate) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really related, but this might read better if we flip the conditionals ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Didn't I see exactly that change in a different PR I was reviewing a few minutes ago? There may be merge conflicts in our future... But yes, I agree switching the order reads better. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, #8066 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like my coding style is fairly consistent 😆 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wanted to make the same change, but resisted the urge in favor of keeping the PR smaller. :) Having this come in via #8066 works well for me. |
||
return SpecifierRequirement(ireq, factory=self) | ||
|
||
def make_requirement_from_candidate(self, candidate): | ||
# type: (Candidate) -> ExplicitRequirement | ||
return ExplicitRequirement(candidate) | ||
|
||
def make_requirement_from_spec(self, specifier, comes_from): | ||
# type: (str, InstallRequirement) -> Requirement | ||
ireq = self._make_install_req_from_spec(specifier, comes_from) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would clone a
pkg>=1.0
without pinning the version ifbase
is not pinned. I think we need to introduce some kind of abstraction toBaseCandidate
to handle this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow.
self.base
is a candidate.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I sort of recall there’s a thing that may go wrong with this, but I forgot what that is now :( Maybe it’s no longer a problem with the new
find_matches()
implementation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, there is a different problem if constraints are involved. We don’t allow constraints to filter direct requirements, so given the following scenario:
This will fail with
installation from path or url cannot be constrained to a version
because we are adding a URL requirement to represent the base.I’m thinking maybe we should get rid of the check altogether, since constraining a URL requirement by checking the version the URL points to kind of still makes sense? @pfmoore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's probably true. I suspect the limitation was there because the old resolver couldn't cope with that situation.
But if we relax that restriction, we'll get additional test failures, and I think we should start being much stricter about not allowing regressions like that (I've just submitted #8297 which should help a bit here, and the fact that the new markers mean that the test suite now succeeds on the new resolver will help as well) so we'd need to fix those tests at the same time (and not by just adding the "fails with the new resolver" flag 🙂 - maybe an xfail on the new resolver?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was a much bigger problem before we had the new implementation, but maybe not so much now. Let's assume it works for the moment, and then when stuff breaks, we'll have a better idea of where there's still an issue (and we can blame @pradyunsg 🙂)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh no. 😮