Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support '--use-feature' in requirements files #8601

Merged
merged 5 commits into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/8601.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Support ``--use-feature`` in requirements files
3 changes: 2 additions & 1 deletion src/pip/_internal/operations/freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def freeze(
'--pre',
'--trusted-host',
'--process-dependency-links',
'--extra-index-url'))):
'--extra-index-url',
'--use-feature'))):
line = line.rstrip()
if line not in emitted_options:
emitted_options.add(line)
Expand Down
1 change: 1 addition & 0 deletions src/pip/_internal/req/req_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
cmdoptions.require_hashes,
cmdoptions.pre,
cmdoptions.trusted_host,
cmdoptions.use_new_feature,
] # type: List[Callable[..., optparse.Option]]

# options to be passed to requirements
Expand Down
1 change: 1 addition & 0 deletions tests/functional/test_freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ def test_freeze_nested_vcs(script, outer_vcs, inner_vcs):
--extra-index-url http://ignore
--find-links http://ignore
--index-url http://ignore
--use-feature 2020-resolver
""")


Expand Down
4 changes: 4 additions & 0 deletions tests/unit/test_req_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,10 @@ def test_set_finder_allow_all_prereleases(self, line_processor, finder):
line_processor("--pre", "file", 1, finder=finder)
assert finder.allow_all_prereleases

def test_use_feature(self, line_processor):
"""--use-feature can be set in requirements files."""
line_processor("--use-feature=2020-resolver", "filename", 1)
rouge8 marked this conversation as resolved.
Show resolved Hide resolved

def test_relative_local_find_links(
self, line_processor, finder, monkeypatch, tmpdir
):
Expand Down