Skip to content

Commit

Permalink
Support '--use-feature' in requirements files
Browse files Browse the repository at this point in the history
This patch adds support for `--use-feature` in requirements files
so that a project that wants all contributers using the same pip
features can specify it in the requirements file. For example, to ensure
a requirements file uses the new resolver:

```
--use-feature=2020-resolver
boto3
boto3==1.13.13
```

This is a new version of pypa#8293.
  • Loading branch information
rouge8 committed Jul 18, 2020
1 parent d01aeaa commit 3099924
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/8600.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Support ``--use-feature`` in requirements files
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
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)

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

0 comments on commit 3099924

Please sign in to comment.