Repository navigation
Honor non-exact version specifiers in the PyPI availability pre-check (fixes #461) - #466
Open
federicocabrera1978-svg wants to merge 1 commit into
Conversation
The PyPI availability pre-check took the version of the first specifier
and asked PyPI for that exact version, even for ranges like 'foo<3' or
'foo>=2.1', giving false negatives (and false positives).
Now the version specific URL is only used for exact pins ('==' without
wildcards, or '==='); for any other specifier the project's releases are
fetched and the check passes only if at least one release (with files)
satisfies the specifier.
Member
|
Hello Federico! We'll take a look at this, thanks! Regarding Thanks again! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #461.
_pypi_head_packageused the version of the first specifier to build a version-specific URL, even for non-exact specifiers. Sorequests<3was checked asrequests==3and reported as non-existent, and ranges could also give false positives.Now:
==Xwithout wildcards, or===X) keep using/pypi/<name>/<version>/json.~=,!=,==X.*, combinations) fetches/pypi/<name>/jsonand passes only if at least one release with files satisfies the specifier (usingSpecifierSet.filter, so pre-releases are considered only when no final release matches, like pip).Added the parametrized test proposed in the issue, plus wildcard and
!=cases. It fails onmaster(foo<3,foo>=2.1,foo>=1,<2,foo==2.*) and passes with this change. Full suite: 377 passed.Note: unrelated to this PR, 12 existing tests fail with
logassert8.7 (latest) and pass with 8.6; happy to open a separate issue.