-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6518 from cjerdonek/issue-6371-ignore-requires-py…
…thon Fix #6371: make pip install respect --ignore-requires-python
- Loading branch information
Showing
6 changed files
with
188 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Fix ``pip install`` to respect ``--ignore-requires-python`` when evaluating | ||
links. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import pytest | ||
from pip._vendor.packaging import specifiers | ||
|
||
from pip._internal.utils.packaging import check_requires_python | ||
|
||
|
||
@pytest.mark.parametrize('version_info, requires_python, expected', [ | ||
((3, 6, 5), '== 3.6.4', False), | ||
((3, 6, 5), '== 3.6.5', True), | ||
((3, 6, 5), None, True), | ||
]) | ||
def test_check_requires_python(version_info, requires_python, expected): | ||
actual = check_requires_python(requires_python, version_info) | ||
assert actual == expected | ||
|
||
|
||
def test_check_requires_python__invalid(): | ||
""" | ||
Test an invalid Requires-Python value. | ||
""" | ||
with pytest.raises(specifiers.InvalidSpecifier): | ||
check_requires_python('invalid', (3, 6, 5)) |