@@ -74,6 +74,7 @@ Each line of the requirements file indicates something to be installed,
74
74
and like arguments to :ref: `pip install `, the following forms are supported::
75
75
76
76
<requirement specifier>
77
+ <requirement specifier> [--install-option="..."] [--global-option="..."]
77
78
<archive url/path>
78
79
[-e] <local project path>
79
80
[-e] <vcs project url>
@@ -90,6 +91,9 @@ A line that begins with ``#`` is treated as a comment and ignored. Whitespace
90
91
followed by a ``# `` causes the ``# `` and the remainder of the line to be
91
92
treated as a comment.
92
93
94
+ A line ending in an unescaped ``\ `` is treated as a line continuation
95
+ and the newline following it is effectively ignored.
96
+
93
97
Additionally, the following Package Index Options are supported:
94
98
95
99
* :ref: `-i, --index-url <--index-url >`
@@ -138,6 +142,40 @@ Some Examples:
138
142
Don't use single or double quotes in a ``requirements.txt `` file.
139
143
140
144
145
+ .. _`Per-requirement Overrides` :
146
+
147
+ Per-requirement Overrides
148
+ +++++++++++++++++++++++++
149
+
150
+ When pip installs packages, it normally executes the ``setup.py `` file
151
+ behind the scenes. You may extend the arguments with which the
152
+ ``setup.py `` file is called through the ``--global-option `` and
153
+ ``--install-option `` options. For example:
154
+
155
+ ::
156
+
157
+ FooProject >= 1.2 --global-option="--no-user-cfg" \
158
+ --install-option="--prefix='/usr/local'" \
159
+ --install-option="--no-compile"
160
+
161
+ The above translates roughly into running FooProject's ``setup.py ``
162
+ script as:
163
+
164
+ ::
165
+
166
+ python setup.py --no-user-cfg install --prefix='/usr/local' --no-compile
167
+
168
+ Note that the only way of giving more than one option to ``setup.py ``
169
+ is through multiple ``--global-option `` and ``--install-option ``
170
+ options, as shown in the example above. The value of each option is
171
+ passed as a single argument to the ``setup.py `` script. Therefore, a
172
+ line such as the following is invalid and would result in an
173
+ installation error.
174
+
175
+ ::
176
+
177
+ # Invalid. Please use '--install-option' twice as shown above.
178
+ FooProject >= 1.2 --install-option="--prefix=/usr/local --no-compile"
141
179
142
180
143
181
.. _`Pre Release Versions` :
0 commit comments