From aca2f6a0c466f19138e2b62565ef5c35db189cef Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 18 Jul 2019 11:00:23 +0200 Subject: [PATCH] Mark multiple extras as not supported yet --- pyproject_buildrequires.py | 6 ++++-- test_pyproject_buildrequires.py | 3 +++ testcases.yaml | 28 ++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/pyproject_buildrequires.py b/pyproject_buildrequires.py index 2a3fa63..f5bdcc6 100644 --- a/pyproject_buildrequires.py +++ b/pyproject_buildrequires.py @@ -212,8 +212,10 @@ def main(argv): ) parser.add_argument( '-x', '--extras', metavar='EXTRAS', default='', - help='comma separated list of "extras" for runtime requirements ' - + '(e.g. -x testing,feature-x)', + help='extra for runtime requirements (e.g. -x testing)', + # XXX: a comma-separated list should be possible here + #help='comma separated list of "extras" for runtime requirements ' + # + '(e.g. -x testing,feature-x)', ) args = parser.parse_args(argv) diff --git a/test_pyproject_buildrequires.py b/test_pyproject_buildrequires.py index b6462b4..9a7c983 100644 --- a/test_pyproject_buildrequires.py +++ b/test_pyproject_buildrequires.py @@ -19,6 +19,9 @@ def test_data(case_name, capsys, tmp_path, monkeypatch): cwd.mkdir() monkeypatch.chdir(cwd) + if case.get('xfail'): + pytest.xfail(case.get('xfail')) + if 'pyproject.toml' in case: cwd.joinpath('pyproject.toml').write_text(case['pyproject.toml']) diff --git a/testcases.yaml b/testcases.yaml index 956e78e..2ca9136 100644 --- a/testcases.yaml +++ b/testcases.yaml @@ -224,3 +224,31 @@ Run dependencies with extras (selected): python3dist(nose) python3dist(requests) result: 0 + +Run dependencies with multiple extras: + xfail: requirement.marker.evaluate seems to not support multiple extras + freeze_output: | + setuptools==50 + wheel==1 + pyyaml==1 + include_runtime: true + extras: testing,more-testing, even-more-testing , cool-feature + setup.py: | + from setuptools import setup + setup( + extras_require={ + 'testing': ['dep1'], + 'more-testing': ['dep2'], + 'even-more-testing': ['dep3'], + 'cool-feature': ['dep4'], + }, + ) + expected: | + python3dist(setuptools) >= 40.8 + python3dist(wheel) + python3dist(wheel) + python3dist(dep1) + python3dist(dep2) + python3dist(dep3) + python3dist(dep4) + result: 0