1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Allow --pre option in requirement files

closes #1273
This commit is contained in:
Xavier Fernandez 2015-08-03 23:07:07 +02:00 committed by Xavier Fernandez
parent ec990fdbcb
commit b290e13cfa
5 changed files with 18 additions and 7 deletions

View file

@ -18,6 +18,8 @@
* Allow ``--process-dependency-links`` within a requirements file. :issue:`1274`.
* Allow ``--pre`` within a requirements file. :issue:`1273`.
**7.1.2 (2015-08-22)**

View file

@ -496,6 +496,14 @@ no_clean = partial(
default=False,
help="Don't clean up build directories.")
pre = partial(
Option,
'--pre',
action='store_true',
default=False,
help="Include pre-release and development versions. By default, "
"pip only finds stable versions.")
disable_pip_version_check = partial(
Option,
"--disable-pip-version-check",

View file

@ -156,13 +156,7 @@ class InstallCommand(RequirementCommand):
cmd_opts.add_option(cmdoptions.no_use_wheel())
cmd_opts.add_option(cmdoptions.no_binary())
cmd_opts.add_option(cmdoptions.only_binary())
cmd_opts.add_option(
'--pre',
action='store_true',
default=False,
help="Include pre-release and development versions. By default, "
"pip only finds stable versions.")
cmd_opts.add_option(cmdoptions.pre())
cmd_opts.add_option(cmdoptions.no_clean())

View file

@ -43,6 +43,7 @@ SUPPORTED_OPTIONS = [
cmdoptions.always_unzip,
cmdoptions.no_binary,
cmdoptions.only_binary,
cmdoptions.pre,
cmdoptions.process_dependency_links,
cmdoptions.trusted_host,
]
@ -220,6 +221,8 @@ def process_line(line, filename, line_number, finder=None, comes_from=None,
if os.path.exists(relative_to_reqs_file):
value = relative_to_reqs_file
finder.find_links.append(value)
if opts.pre:
finder.allow_all_prereleases = True
if opts.process_dependency_links:
finder.process_dependency_links = True
if opts.trusted_hosts:

View file

@ -214,6 +214,10 @@ class TestProcessLine(object):
# noop, but confirm it can be set
list(process_line("--no-allow-insecure", "file", 1, finder=finder))
def test_set_finder_allow_all_prereleases(self, finder):
list(process_line("--pre", "file", 1, finder=finder))
assert finder.allow_all_prereleases
def test_relative_local_find_links(self, finder, monkeypatch):
"""
Test a relative find_links path is joined with the req file directory