Respond to feedback, and add functional tests.

This commit is contained in:
Daniel Katz 2020-09-09 09:58:58 -04:00
parent abf987bde3
commit 7237bd3397
2 changed files with 36 additions and 5 deletions

View File

@ -31,7 +31,7 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from optparse import OptionParser, Values
from typing import Any, Callable, Dict, List, Optional, Tuple
from typing import Any, Callable, Dict, Optional, Tuple
from pip._internal.cli.parser import ConfigOptionParser
@ -498,8 +498,8 @@ platform = partial(
action='append',
default=None,
help=("Only use wheels compatible with <platform>. Defaults to the "
"platform of the running system. Use multiple options to specify "
"multiple platforms supported by the target interpreter."),
"platform of the running system. Use this option multiple times to "
"specify multiple platforms supported by the target interpreter."),
) # type: Callable[..., Option]
@ -592,8 +592,8 @@ abi = partial(
default=None,
help=("Only use wheels compatible with Python abi <abi>, e.g. 'pypy_41'. "
"If not specified, then the current interpreter abi tag is used. "
"Use multiple options to specify multiple abis supported by the "
"target interpreter. Generally you will need to specify "
"Use this option multiple times to specify multiple abis supported "
"by the target interpreter. Generally you will need to specify "
"--implementation, --platform, and --python-version when using this "
"option."),
) # type: Callable[..., Option]

View File

@ -309,6 +309,21 @@ def test_download_specify_platform(script, data):
Path('scratch') / 'fake-2.0-py2.py3-none-linux_x86_64.whl'
)
# Test with multiple supported platforms specified.
data.reset()
fake_wheel(data, 'fake-3.0-py2.py3-none-linux_x86_64.whl')
result = script.pip(
'download', '--no-index', '--find-links', data.find_links,
'--only-binary=:all:',
'--dest', '.',
'--platform', 'manylinux1_x86_64', '--platform', 'linux_x86_64',
'--platform', 'any',
'fake==3'
)
result.did_create(
Path('scratch') / 'fake-3.0-py2.py3-none-linux_x86_64.whl'
)
class TestDownloadPlatformManylinuxes(object):
"""
@ -575,6 +590,22 @@ def test_download_specify_abi(script, data):
expect_error=True,
)
data.reset()
fake_wheel(data, 'fake-1.0-fk2-otherabi-fake_platform.whl')
result = script.pip(
'download', '--no-index', '--find-links', data.find_links,
'--only-binary=:all:',
'--dest', '.',
'--python-version', '2',
'--implementation', 'fk',
'--platform', 'fake_platform',
'--abi', 'fakeabi', '--abi', 'otherabi', '--abi', 'none',
'fake'
)
result.did_create(
Path('scratch') / 'fake-1.0-fk2-otherabi-fake_platform.whl'
)
def test_download_specify_implementation(script, data):
"""