Skip to content
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

Adding Python-esque test cases #27

Closed
pradyunsg opened this issue Feb 5, 2020 · 19 comments
Closed

Adding Python-esque test cases #27

pradyunsg opened this issue Feb 5, 2020 · 19 comments

Comments

@pradyunsg
Copy link
Contributor

One of the things that can be found in zazo's issue tracker, is a bunch of Python-specific failure cases for the current pip resolver.

It might be useful to add test cases for those situations. Another case that would be really handy would be to have test cases for some successful situations, like installing https://libraries.io/github/aws/chalice -- which depends on 35+ packages directly, including botocore, which has 900+ releases.

@pradyunsg pradyunsg changed the title Adding a Python-esque test cases Adding Python-esque test cases Feb 5, 2020
@pradyunsg
Copy link
Contributor Author

I suggest creating a script that fetches metadata from PyPI's JSON API for a package for all versions of that package, and dumps those details into a file (skipping packages without dependency metadata from the API). Then running this script for with all packages that get installed when you do pip install chalice will give you all the information needed to construct the test case.

@uranusjr
Copy link
Member

uranusjr commented Feb 5, 2020

I suggest creating a script that fetches metadata from PyPI's JSON API for a package for all versions of that package, and dumps those details into a file

Many of Monilino’s test cases are built this way (from RubyGems), and I’m 100% on board. It wouldn’t be a terrible idea to read from wheels even IMO since the spec generation is a one-off event.

@pradyunsg
Copy link
Contributor Author

pypa/pip#7096

^ another simple-but-interesting case. :)

@pradyunsg
Copy link
Contributor Author

/cc @pfmoore in case he's interested in taking a look at this.

@uranusjr
Copy link
Member

uranusjr commented Feb 6, 2020

Note: There are some cases raised in pypa/pip#7406 as well.

@pradyunsg
Copy link
Contributor Author

You can probably directly use https://github.com/chrahunt/packages. :)

@uranusjr
Copy link
Member

One more pypa/pip#7714

@uranusjr
Copy link
Member

(BTW I started implementing this in the pypi-tests branch.)

@pradyunsg
Copy link
Contributor Author

File a draft PR for the WIP branch?

@pradyunsg
Copy link
Contributor Author

One place worth "mining" is... pypa/pip#988. A lot of issues related to dependency resolution on pip's issue tracker were closed by cross-linking to that issue -- if you're looking for additional test cases, that'd be a good place to dig up for them.

@uranusjr
Copy link
Member

uranusjr commented Feb 13, 2020

@uranusjr
Copy link
Member

To reproduce the virtualenv + pre-commit error:

$ pip install "virtualenv<20" "six<1.12.0" "tox==3.14.2"
...

$ pip install -U "tox<3.14.4" virtualenv
...
ERROR: virtualenv 20.0.3 has requirement six<2,>=1.12.0, but you'll have six 1.11.0 which is incompatible.
...

Quoting @pfmoore from Zulip:

If a user installs something like tox, which depends directly on six, as well as indirectly via virtualenv, and the user has an older version of six installed, the current resolver sees the first dependency, notes that it's satisfies, and ignores the subsequent dependency. Result - virtualenv breaks because it wants to call a version of six that isn't installed.

Quoting myself:

The current resolver would “successfully” resolve if you swap the packages to update (pip install -U virtualenv "tox<3.14.4") because “first found wins”.

@uranusjr
Copy link
Member

Two improvements (bugfixes?) are needed:

  • Can’t find any links for PyYAML, but there are clearly compatible wheels. Need to investigate
  • Need a way to provide dependencies for sdist-only projects. Two are known: bokeh and toolz.

@pradyunsg
Copy link
Contributor Author

pradyunsg commented Mar 8, 2020

Another case: python-poetry/poetry#2094

  • allennlp == 0.9.0

@uranusjr
Copy link
Member

uranusjr commented Mar 9, 2020

We’d probably want to add a timeout to the new resolver for the initial rollout, to avoid users waiting indefinitely. (If the resolver takes too long, give up and tell them to report the issue.)

@pradyunsg
Copy link
Contributor Author

I think we should keep track of number of backtracks done, which would allow us to be insensitive to network latency, and the "oh, it's taking too long" would be dependent on the graph, rather than other system/external characteristics.

@uranusjr
Copy link
Member

uranusjr commented Mar 9, 2020

There’s currently not a hook to report how many backtrack steps were taken :p I think it would be acceptable to use “rounds” instead though, which counts forward steps.

@pradyunsg
Copy link
Contributor Author

pradyunsg commented Apr 24, 2020

Pinging @sdispater for inputs here!

@sdispater Do you have any suggestions for here, other than pyrax and oslo.utils?

I see user reports for things like allennlp and newspaper3k on poetry's issue tracker and I'm wondering if you remember edge cases that you had to fix in poetry's resolver as part of user reports that aren't covered by the aforementioned cases.

@uranusjr
Copy link
Member

I’m closing this since the repo has acquired several tests from pip users now. We can always add more when they come up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants