summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Katz <katzdm@gmail.com>2020-09-09 09:58:58 -0400
committerDaniel Katz <katzdm@gmail.com>2020-10-27 19:00:22 -0400
commit7237bd3397dd22a44ea65bb869d15d7b5e6a4310 (patch)
treef3ac82f4a4f90a596b8ede706bf6882748ad3da2
parentabf987bde3d3fa019189f252152aa018b3b0a30d (diff)
downloadpip-7237bd3397dd22a44ea65bb869d15d7b5e6a4310.tar.gz
Respond to feedback, and add functional tests.
-rw-r--r--src/pip/_internal/cli/cmdoptions.py10
-rw-r--r--tests/functional/test_download.py31
2 files changed, 36 insertions, 5 deletions
diff --git a/src/pip/_internal/cli/cmdoptions.py b/src/pip/_internal/cli/cmdoptions.py
index e65ce84c8..d7b272ef3 100644
--- a/src/pip/_internal/cli/cmdoptions.py
+++ b/src/pip/_internal/cli/cmdoptions.py
@@ -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]
diff --git a/tests/functional/test_download.py b/tests/functional/test_download.py
index 3291d580d..2eee51b08 100644
--- a/tests/functional/test_download.py
+++ b/tests/functional/test_download.py
@@ -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):
"""