Here is one that is more complete:

https://gist.github.com/harlowja/e22e8c0771b336ca392f

Using a really simple requirement set that will not work:

$ cat test.txt
taskflow
networkx<1.5

Running the above gist on that (and waiting for a while; since it does do a lot of backtracking and trying of different versions....) the program will eventually break with something like the following:

http://paste.ubuntu.com/9907530/

The above can likely be optimized more (to avoid diving into requirements that have already failed being selected) but it does seem to work as a satisfiability solver that will recursively check requirements deeply and try as many solutions as possible (with backtracking when a requirement is selected that doesn't work).

-Josh

Joshua Harlow wrote:
Seems like a simple fix?

https://github.com/pypa/pip/blob/1.5.6/pip/req.py#L1536

Make a new session somewhere in that gist/code and profit?

Kevin L. Mitchell wrote:
On Wed, 2015-01-21 at 18:48 -0800, Joshua Harlow wrote:
Another thing that I just started whipping together:

https://gist.github.com/harlowja/5e39ec5ca9e3f0d9a21f

One problem, though, is that parse_requirements() now requires the
session keyword argument. In version 6.0.6, parse_requirements() begins
with:

def parse_requirements(filename, finder=None, comes_from=None,
options=None,
session=None):
if session is None:
raise TypeError(
"parse_requirements() missing 1 required keyword argument: "
"'session'"
)

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to