-
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 #8588 from McSinyx/fast-deps
Use lazy wheel to obtain dep info for new resolver
- Loading branch information
Showing
9 changed files
with
124 additions
and
16 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,3 @@ | ||
Allow the new resolver to obtain dependency information through wheels | ||
lazily downloaded using HTTP range requests. To enable this feature, | ||
invoke ``pip`` with ``--use-feature=fast-deps``. |
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
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,9 @@ | ||
[build-system] | ||
requires = ['flit_core >=2,<4'] | ||
build-backend = 'flit_core.buildapi' | ||
|
||
[tool.flit.metadata] | ||
module = 'requiresPaste' | ||
author = 'A. Random Developer' | ||
author-email = '[email protected]' | ||
requires = ['Paste==3.4.2'] |
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,3 @@ | ||
"""Module requiring Paste to test dependencies download of pip wheel.""" | ||
|
||
__version__ = '3.1.4' |
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,50 @@ | ||
import fnmatch | ||
import json | ||
from os.path import basename | ||
|
||
from pip._vendor.packaging.utils import canonicalize_name | ||
from pytest import mark | ||
|
||
|
||
def pip(script, command, requirement): | ||
return script.pip( | ||
command, '--prefer-binary', '--no-cache-dir', | ||
'--use-feature=fast-deps', requirement, | ||
allow_stderr_warning=True, | ||
) | ||
|
||
|
||
def assert_installed(script, names): | ||
list_output = json.loads(script.pip('list', '--format=json').stdout) | ||
installed = {canonicalize_name(item['name']) for item in list_output} | ||
assert installed.issuperset(map(canonicalize_name, names)) | ||
|
||
|
||
@mark.network | ||
@mark.parametrize(('requirement', 'expected'), ( | ||
('Paste==3.4.2', ('Paste', 'six')), | ||
('Paste[flup]==3.4.2', ('Paste', 'six', 'flup')), | ||
)) | ||
def test_install_from_pypi(requirement, expected, script): | ||
pip(script, 'install', requirement) | ||
assert_installed(script, expected) | ||
|
||
|
||
@mark.network | ||
@mark.parametrize(('requirement', 'expected'), ( | ||
('Paste==3.4.2', ('Paste-3.4.2-*.whl', 'six-*.whl')), | ||
('Paste[flup]==3.4.2', ('Paste-3.4.2-*.whl', 'six-*.whl', 'flup-*')), | ||
)) | ||
def test_download_from_pypi(requirement, expected, script): | ||
result = pip(script, 'download', requirement) | ||
created = list(map(basename, result.files_created)) | ||
assert all(fnmatch.filter(created, f) for f in expected) | ||
|
||
|
||
@mark.network | ||
def test_build_wheel_with_deps(data, script): | ||
result = pip(script, 'wheel', data.packages/'requiresPaste') | ||
created = list(map(basename, result.files_created)) | ||
assert fnmatch.filter(created, 'requiresPaste-3.1.4-*.whl') | ||
assert fnmatch.filter(created, 'Paste-3.4.2-*.whl') | ||
assert fnmatch.filter(created, 'six-*.whl') |