Skip to content

Commit c12157d

Browse files
committed
Respond to feedback, and add functional tests.
1 parent 42b7478 commit c12157d

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

src/pip/_internal/cli/cmdoptions.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
if MYPY_CHECK_RUNNING:
3333
from optparse import OptionParser, Values
34-
from typing import Any, Callable, Dict, List, Optional, Tuple
34+
from typing import Any, Callable, Dict, Optional, Tuple
3535

3636
from pip._internal.cli.parser import ConfigOptionParser
3737

@@ -498,8 +498,8 @@ def only_binary():
498498
action='append',
499499
default=None,
500500
help=("Only use wheels compatible with <platform>. Defaults to the "
501-
"platform of the running system. Use multiple options to specify "
502-
"multiple platforms supported by the target interpreter."),
501+
"platform of the running system. Use this option multiple times to "
502+
"specify multiple platforms supported by the target interpreter."),
503503
) # type: Callable[..., Option]
504504

505505

@@ -592,8 +592,8 @@ def _handle_python_version(option, opt_str, value, parser):
592592
default=None,
593593
help=("Only use wheels compatible with Python abi <abi>, e.g. 'pypy_41'. "
594594
"If not specified, then the current interpreter abi tag is used. "
595-
"Use multiple options to specify multiple abis supported by the "
596-
"target interpreter. Generally you will need to specify "
595+
"Use this option multiple times to specify multiple abis supported "
596+
"by the target interpreter. Generally you will need to specify "
597597
"--implementation, --platform, and --python-version when using this "
598598
"option."),
599599
) # type: Callable[..., Option]

tests/functional/test_download.py

+31
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,21 @@ def test_download_specify_platform(script, data):
309309
Path('scratch') / 'fake-2.0-py2.py3-none-linux_x86_64.whl'
310310
)
311311

312+
# Test with multiple supported platforms specified.
313+
data.reset()
314+
fake_wheel(data, 'fake-3.0-py2.py3-none-linux_x86_64.whl')
315+
result = script.pip(
316+
'download', '--no-index', '--find-links', data.find_links,
317+
'--only-binary=:all:',
318+
'--dest', '.',
319+
'--platform', 'manylinux1_x86_64', '--platform', 'linux_x86_64',
320+
'--platform', 'any',
321+
'fake==3'
322+
)
323+
result.did_create(
324+
Path('scratch') / 'fake-3.0-py2.py3-none-linux_x86_64.whl'
325+
)
326+
312327

313328
class TestDownloadPlatformManylinuxes(object):
314329
"""
@@ -575,6 +590,22 @@ def test_download_specify_abi(script, data):
575590
expect_error=True,
576591
)
577592

593+
data.reset()
594+
fake_wheel(data, 'fake-1.0-fk2-otherabi-fake_platform.whl')
595+
result = script.pip(
596+
'download', '--no-index', '--find-links', data.find_links,
597+
'--only-binary=:all:',
598+
'--dest', '.',
599+
'--python-version', '2',
600+
'--implementation', 'fk',
601+
'--platform', 'fake_platform',
602+
'--abi', 'fakeabi', '--abi', 'otherabi', '--abi', 'none',
603+
'fake'
604+
)
605+
result.did_create(
606+
Path('scratch') / 'fake-1.0-fk2-otherabi-fake_platform.whl'
607+
)
608+
578609

579610
def test_download_specify_implementation(script, data):
580611
"""

0 commit comments

Comments
 (0)