diff --git a/news/8293.feature b/news/8293.feature new file mode 100644 index 00000000000..482a58b0e67 --- /dev/null +++ b/news/8293.feature @@ -0,0 +1 @@ +Support ``--unstable-feature`` in requirements files diff --git a/src/pip/_internal/req/req_file.py b/src/pip/_internal/req/req_file.py index 63cab76f6f2..0a540bdcfa4 100644 --- a/src/pip/_internal/req/req_file.py +++ b/src/pip/_internal/req/req_file.py @@ -63,6 +63,7 @@ cmdoptions.require_hashes, cmdoptions.pre, cmdoptions.trusted_host, + cmdoptions.unstable_feature, cmdoptions.always_unzip, # Deprecated ] # type: List[Callable[..., optparse.Option]] diff --git a/tests/unit/test_req_file.py b/tests/unit/test_req_file.py index 4ef4f7217e0..a49b8091ef3 100644 --- a/tests/unit/test_req_file.py +++ b/tests/unit/test_req_file.py @@ -382,6 +382,10 @@ def test_noop_always_unzip(self, line_processor, finder): # noop, but confirm it can be set line_processor("--always-unzip", "file", 1, finder=finder) + def test_unstable_feature(self, line_processor): + """--unstable-feature can be set in requirements files.""" + line_processor("--unstable-feature=resolver", "filename", 1) + def test_set_finder_allow_all_prereleases(self, line_processor, finder): line_processor("--pre", "file", 1, finder=finder) assert finder.allow_all_prereleases