Skip to content

Commit

Permalink
Merge pull request #1859 from nailor/support-no-use-wheel
Browse files Browse the repository at this point in the history
req: Support --no-use-wheel flag in requirements.txt
  • Loading branch information
dstufft committed Jun 26, 2014
2 parents 791aceb + 2f5b044 commit 6876d4b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/reference/pip_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Additionally, the following Package Index Options are supported:
* :ref:`--allow-external <--allow-external>`
* :ref:`--allow-all-external <--allow-external>`
* :ref:`--allow-unverified <--allow-unverified>`
* :ref:`--no-use-wheel <install_--no-use-wheel>`

For example, to specify :ref:`--no-index <--no-index>` and 2 :ref:`--find-links <--find-links>` locations:

Expand Down
5 changes: 4 additions & 1 deletion pip/req/req_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ def parse_requirements(filename, finder=None, comes_from=None, options=None,
if finder:
finder.index_urls.append(line)
elif line.startswith('--use-wheel'):
finder.use_wheel = True
# Default in 1.6
pass
elif line.startswith('--no-use-wheel'):
finder.use_wheel = False
elif line.startswith('--no-index'):
finder.index_urls = []
elif line.startswith("--allow-external"):
Expand Down
2 changes: 1 addition & 1 deletion tests/data/reqfiles/supported_options.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# requirement file containing various supported options
--use-wheel
--no-use-wheel
6 changes: 3 additions & 3 deletions tests/unit/test_req.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,16 @@ def test_remote_reqs_parse():
pass


def test_req_file_parse_use_wheel(data):
def test_req_file_parse_no_use_wheel(data):
"""
Test parsing --use-wheel from a req file
Test parsing --no-use-wheel from a req file
"""
finder = PackageFinder([], [], session=PipSession())
for req in parse_requirements(
data.reqfiles.join("supported_options.txt"), finder,
session=PipSession()):
pass
assert finder.use_wheel
assert not finder.use_wheel


def test_req_file_parse_comment_start_of_line(tmpdir):
Expand Down

0 comments on commit 6876d4b

Please sign in to comment.