mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Respond to feedback, and add functional tests.
This commit is contained in:
parent
abf987bde3
commit
7237bd3397
|
@ -31,7 +31,7 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from optparse import OptionParser, Values
|
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
|
from pip._internal.cli.parser import ConfigOptionParser
|
||||||
|
|
||||||
|
@ -498,8 +498,8 @@ platform = partial(
|
||||||
action='append',
|
action='append',
|
||||||
default=None,
|
default=None,
|
||||||
help=("Only use wheels compatible with <platform>. Defaults to the "
|
help=("Only use wheels compatible with <platform>. Defaults to the "
|
||||||
"platform of the running system. Use multiple options to specify "
|
"platform of the running system. Use this option multiple times to "
|
||||||
"multiple platforms supported by the target interpreter."),
|
"specify multiple platforms supported by the target interpreter."),
|
||||||
) # type: Callable[..., Option]
|
) # type: Callable[..., Option]
|
||||||
|
|
||||||
|
|
||||||
|
@ -592,8 +592,8 @@ abi = partial(
|
||||||
default=None,
|
default=None,
|
||||||
help=("Only use wheels compatible with Python abi <abi>, e.g. 'pypy_41'. "
|
help=("Only use wheels compatible with Python abi <abi>, e.g. 'pypy_41'. "
|
||||||
"If not specified, then the current interpreter abi tag is used. "
|
"If not specified, then the current interpreter abi tag is used. "
|
||||||
"Use multiple options to specify multiple abis supported by the "
|
"Use this option multiple times to specify multiple abis supported "
|
||||||
"target interpreter. Generally you will need to specify "
|
"by the target interpreter. Generally you will need to specify "
|
||||||
"--implementation, --platform, and --python-version when using this "
|
"--implementation, --platform, and --python-version when using this "
|
||||||
"option."),
|
"option."),
|
||||||
) # type: Callable[..., Option]
|
) # type: Callable[..., Option]
|
||||||
|
|
|
@ -309,6 +309,21 @@ def test_download_specify_platform(script, data):
|
||||||
Path('scratch') / 'fake-2.0-py2.py3-none-linux_x86_64.whl'
|
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):
|
class TestDownloadPlatformManylinuxes(object):
|
||||||
"""
|
"""
|
||||||
|
@ -575,6 +590,22 @@ def test_download_specify_abi(script, data):
|
||||||
expect_error=True,
|
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):
|
def test_download_specify_implementation(script, data):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue