Skip to content

Commit 054fa6c

Browse files
committed
Replace all occurrences of install|global-options with install|global-option
1 parent b015451 commit 054fa6c

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

docs/reference/pip_install.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Each line of the requirements file indicates something to be installed,
2525
and like arguments to :ref:`pip install`, the following forms are supported::
2626

2727
<requirement specifier>
28-
<requirement specifier> [--install-options="..."] [--global-options="..."]
28+
<requirement specifier> [--install-option="..."] [--global-option="..."]
2929
<archive url/path>
3030
[-e] <local project path>
3131
[-e] <vcs project url>
@@ -98,13 +98,13 @@ Some Examples:
9898
Per-requirement Overrides
9999
+++++++++++++++++++++++++
100100

101-
It is possible to set ``--install-options`` and ``--global-options``
101+
It is possible to set ``--install-option`` and ``--global-option``
102102
for each requirement in the requirements file:
103103

104104
::
105105

106-
FooProject >= 1.2 --install-options="--prefix='/usr/local'" \
107-
--global-options="--no-user-cfg"
106+
FooProject >= 1.2 --install-option="--prefix='/usr/local'" \
107+
--global-option="--no-user-cfg"
108108

109109
The above translates roughly into running FooProject's ``setup.py``
110110
script as:

pip/req/req_file.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@
4444
])
4545

4646
# The following options and flags can be used on requirement lines.
47-
# For example: INITools==0.2 --install-options="--prefix=/opt"
47+
# For example: INITools==0.2 --install-option="--prefix=/opt"
4848
parser_requirement_flags = set()
4949
parser_requirement_options = set([
50-
'--install-options',
51-
'--global-options',
50+
'--install-option',
51+
'--global-option',
5252
])
5353

5454
# The types of lines understood by the requirements file parser.
@@ -107,7 +107,7 @@ def parse_content(filename, content, finder=None, comes_from=None, options=None,
107107

108108
# InstallRequirement.install() expects these options to be lists.
109109
if opts:
110-
for opt in '--global-options', '--install-options':
110+
for opt in '--global-option', '--install-option':
111111
opts[opt] = shlex.split(opts[opt]) if opt in opts else []
112112

113113
comes_from = '-r %s (line %s)' % (filename, line_number)

pip/req/req_install.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,8 @@ def install(self, install_options, global_options=[], root=None):
784784
# Options specified in requirements file override those
785785
# specified on the command line, since the last option given
786786
# to setup.py is the one that is used.
787-
global_options += self.options.get('--global-options', [])
788-
install_options += self.options.get('--install-options', [])
787+
global_options += self.options.get('--global-option', [])
788+
install_options += self.options.get('--install-option', [])
789789

790790
if self.isolated:
791791
global_options = list(global_options) + ["--no-user-cfg"]

tests/unit/test_req.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -466,25 +466,25 @@ def test_get_requirement_options():
466466
res = pro('--aflag --bflag', ['--aflag', '--bflag'])
467467
assert res == {'--aflag': '', '--bflag': ''}
468468

469-
res = pro('--install-options="--abc --zxc"', [], ['--install-options'])
470-
assert res == {'--install-options': '--abc --zxc'}
469+
res = pro('--install-option="--abc --zxc"', [], ['--install-option'])
470+
assert res == {'--install-option': '--abc --zxc'}
471471

472-
res = pro('--aflag --global-options="--abc" --install-options="--aflag"',
473-
['--aflag'], ['--install-options', '--global-options'])
474-
assert res == {'--aflag': '', '--global-options': '--abc', '--install-options': '--aflag'}
472+
res = pro('--aflag --global-option="--abc" --install-option="--aflag"',
473+
['--aflag'], ['--install-option', '--global-option'])
474+
assert res == {'--aflag': '', '--global-option': '--abc', '--install-option': '--aflag'}
475475

476-
line = 'INITools==2.0 --global-options="--one --two -3" --install-options="--prefix=/opt"'
476+
line = 'INITools==2.0 --global-option="--one --two -3" --install-option="--prefix=/opt"'
477477
assert parse_line(line) == (REQUIREMENT, (
478478
'INITools==2.0', {
479-
'--global-options': '--one --two -3',
480-
'--install-options': '--prefix=/opt'
479+
'--global-option': '--one --two -3',
480+
'--install-option': '--prefix=/opt'
481481
}))
482482

483483

484484
def test_install_requirements_with_options(tmpdir, finder, session):
485485
content = '''
486-
INITools == 2.0 --global-options="--one --two -3" \
487-
--install-options="--prefix=/opt"
486+
INITools == 2.0 --global-option="--one --two -3" \
487+
--install-option"--prefix=/opt"
488488
'''
489489

490490
req_path = tmpdir.join('requirements.txt')
@@ -504,4 +504,4 @@ def test_install_requirements_with_options(tmpdir, finder, session):
504504
for i in '--one', '--two', '-3', '--prefix=/opt':
505505
assert i in call
506506

507-
# TODO: assert that --global-options come before --install-options.
507+
# TODO: assert that --global-option come before --install-option.

0 commit comments

Comments
 (0)