Support multiple vendor files in pythonbundles.py

Not bumping the release, will happily wait until it bubbles trough.
This commit is contained in:
Miro Hrončok 2021-06-21 11:35:48 +02:00 committed by churchyard
commit 9bd2a43a74
5 changed files with 53 additions and 21 deletions

View file

@ -0,0 +1,5 @@
Provides: bundled(python3dist(appdirs)) = 1.4.3
Provides: bundled(python3dist(ordered-set)) = 3.1.1
Provides: bundled(python3dist(packaging)) = 16.8
Provides: bundled(python3dist(pyparsing)) = 2.2.1
Provides: bundled(python3dist(six)) = 1.10

View file

@ -0,0 +1,3 @@
packaging==16.8
pyparsing==2.2.1
ordered-set==3.1.1

View file

@ -0,0 +1,3 @@
Provides: bundled(python3dist(ordered-set)) = 3.1.1
Provides: bundled(python3dist(packaging)) = 16.8
Provides: bundled(python3dist(pyparsing)) = 2.2.1

View file

@ -34,7 +34,7 @@ def run_pythonbundles(*args, success=True):
return cp
projects = pytest.mark.parametrize('project', ('pkg_resources', 'pip', 'pipenv'))
projects = pytest.mark.parametrize('project', ('pkg_resources', 'pip', 'pipenv', 'setuptools'))
@projects
@ -97,3 +97,23 @@ def test_compare_with_unexpected(project):
cp = run_pythonbundles(TEST_DATA / f'{project}.in', '--compare-with', longer, success=False)
assert cp.stdout == '', cp.stdout
assert cp.stderr == f'Redundant unexpected provides:\n + {unexpected}\n', cp.stderr
combo_order = pytest.mark.parametrize('projects', ['pkg_resources-setuptools', 'setuptools-pkg_resources'])
@combo_order
def test_multiple_vendor_files_output(projects):
cp = run_pythonbundles(*(TEST_DATA / f'{p}.in' for p in projects.split('-')))
expected = (TEST_DATA / 'pkg_resources_setuptools.out').read_text()
assert cp.stdout == expected, cp.stdout
assert cp.stderr == '', cp.stderr
@combo_order
def test_multiple_vendor_files_compare_with(projects):
expected = (TEST_DATA / 'pkg_resources_setuptools.out').read_text()
cp = run_pythonbundles(*(TEST_DATA / f'{p}.in' for p in projects.split('-')),
'--compare-with', expected)
assert cp.stdout == '', cp.stdout
assert cp.stderr == '', cp.stderr