-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Make Resolver.resolve take a plain list of InstallRequirement #7571
Comments
One issue with globally managing the temporary build directory is that One possible way to work around this is to reason about when |
I don't think we need to get rid of all of The main bit that causes entanglement is the I think the approach to take for that, is to not use The main benefit of going this route, would be minimizing the amount of "turmoil" needed prior to working on the new resolver. To get rid of One change that IMO we should make here would be to start returning a |
PS: I don't think this has anything to do with build logic -- this is almost completely around pip's resolution logic and semantics (what will be downloaded/built vs the actually process of running the build). |
Agreed. Simplifying the interface is the main point. |
Your items 1, 2 and 3 seem to be more around temporary directory management (disclaimer: I've not looked at the code yet, so this is based solely on your description). They seem like a good change to make in any case. I'm less sure about 4 and 5, which are directly related to the resolver. At this point in time, I don't think we can really say what the best interface to the resolver will be, and I'm reluctant to make changes without a clear goal in mind. For example, I'm currently thinking that there are two distinct types of "requirement":
With that in mind, a So basically I'm saying let's hold off on doing anything drastic with 1 I know that has a different, specific meaning to pip, I'm only using the term here for purposes of discussion. |
Reading the code (and trying to get an idea how the new resolver can be fitted in), I feel the problem is not the resolver mutates Since I haven’t seen it mentioned, |
We can avoid implementing this in the new resolver if we move the actual downloaded file copying to |
I agree we don’t want use This might be because I am far less familiar with how |
I think it'll be as easy as you're thinking it'd be -- add the items using the |
Quoting a past me:
From #6607 (comment) |
Update from the future: Turns out this is still needed because Issues impacted by this include:
|
Just to say that #7096 (and possibly #8036) were closed in favour of this issue, but this issue has since been closed by #8061 which doesn't solve the issue. I added xfail tests for #7096 in #8059, which are still xfailing. Is there a place we can track those issues, or should this issue be re-opened? |
@pelson We opted to write an entirely different dependency resolver to solve the issue (among many others) instead. See #8099 for more details. The new resolver should not hanve those issues (please report if they do!), and the current (legacy) resolver will be retired after the new resolver gains sufficient usage according to the plan laid out in #8371 (comment). |
What's the problem this feature will solve?
Currently pip's resolver logic is spread between
pip._internal.req.req_set.RequirementSet
andpip._internal.legacy_resolve.Resolver
, among other classes. Regardless of the approach taken for implementing the new resolver, simplifying the interface to theresolve
function will help us re-use more code before and after the call toresolve
without having to consider the legacy resolution logic currently inRequirementSet
.Describe the solution you'd like
Several steps should let us get rid of
RequirementSet
as an input toResolver
:InstallRequirement.remove_temporary_source
to be globally managed and subject to the configuration from the previous step. RemoveInstallRequirement.remove_temporary_source
RequirementSet.cleanup_files
since it only callsInstallRequirement.remove_temporary_source
RequirementSet
inResolver.resolve
fromroot_reqs
and use that during resolution. Return the newRequirementSet
, which callers should use for the next step of processing instead of the inputRequirementSet
they were using previously.RequirementSet
toResolver.resolve
, passreq_set.unnamed_requirements + list(req_set.requirements.values())
intoResolver.resolve
similar to what is currently calculated withinResolver.resolve
here.After these steps, we should be able to fork
RequirementSet
into one class for use with initial requirement parsing here (which could be eventually simplified to a plain list), and another class for use withinResolver
(which could potentially be inlined into Resolver itself).Alternative Solutions
RequirementSet
as the interface toResolver.resolve
and suffer since much of its logic is closely tied to the current method of dependency resolution/preparation, which would conflict with any new resolver.Additional context
The text was updated successfully, but these errors were encountered: