question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Returning a RequirementSet from Resolver.resolve

See original GitHub issue

Description Currently, pip’s Resolver.resolve method is expected to mutate the RequirementSet provided to it; which results in a slightly difficult to follow control flow.

Desired behavior

Resolver.resolve(req_set: RequirementSet) -> RequirementSet

Known Challenges pip’s install, download and wheel commands, have a requirement_set.cleanup_files() call in a try-finally, which means that the existing requirement set is clearly assumed to be the only one that exists. We’d likely want to construct a new set in the new resolver, so figuring out how we’d handle cleanups is the main thing to do here.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
pfmoorecommented, Feb 4, 2020

I’ve unassigned myself from this because I’m struggling to understand what it actually means. I get the broader goal of improving the control flow, and decoupling “before the resolve” from “after the resolve”, but I’m not clear how this specific change would work in that context. So rather than block someone else from looking at it, I’ve unassigned myself.

0reactions
chrahuntcommented, Jan 31, 2020

why would the resolver result need to include a “force install” option?

It wouldn’t need to, you’re right. As long as we enrich the resolver result with information indicating that some of the things already installed will need to be force-reinstalled then I think that’s good enough. The resolver doesn’t need to know about a “force install” option. Above I was imagining it from the perspective of a function that would take a “resolver result” (and an install scheme) and do the required installations with no other input.

The resolver just returns a list of what resolvelib calls “Candidates” - essentially project name and version.

In my view the resolver will return Projects (or some wrapper around them), or objects that we use as an index into a lookup table of the Projects that have been used during the resolution process.

The rest of your statements sound reasonable to me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular2: Return an object in a resolver - Stack Overflow
The Observable.of(false) seems to work, I go to the homepage, but with Observable.of(result) , I don't get the result in my component ......
Read more >
Python Resolver.resolve Examples ...
Python Resolver.resolve - 4 examples found. These are the top rated real world Python examples of pipenvpatchednotpip_internalresolve.
Read more >
src/pip/_internal/resolution/legacy/resolver.py - Fossies
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting...
Read more >
https://www.pi-dev.co.id/kesehatansistem/be/env/li...
_internal.req.req_set import RequirementSet from pip._internal.resolution.base import BaseResolver from pip._internal.resolution.resolvelib.provider import ...
Read more >
src « felix « org.eclipse.osgi « bundles - rt.equinox.framework.git
path: root/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/ResolverImpl.java ... newFixedThreadPool(m_parallelism); try { return resolve(rc, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found