Add tests for pinned software in setup.py of test project
This commit is contained in:
@@ -96,6 +96,7 @@ def test_dependency_constraints_file(tmp_path):
|
|||||||
'pip': '19.2.3',
|
'pip': '19.2.3',
|
||||||
'setuptools': '43.0.0',
|
'setuptools': '43.0.0',
|
||||||
'wheel': '0.33.6',
|
'wheel': '0.33.6',
|
||||||
|
'virtualenv': '16.7.8',
|
||||||
}
|
}
|
||||||
|
|
||||||
constraints_file = tmp_path / 'constraints.txt'
|
constraints_file = tmp_path / 'constraints.txt'
|
||||||
@@ -104,6 +105,7 @@ def test_dependency_constraints_file(tmp_path):
|
|||||||
pip=={pip}
|
pip=={pip}
|
||||||
setuptools=={setuptools}
|
setuptools=={setuptools}
|
||||||
wheel=={wheel}
|
wheel=={wheel}
|
||||||
|
virtualenv=={virtualenv}
|
||||||
'''.format(**tool_versions)
|
'''.format(**tool_versions)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,25 @@
|
|||||||
|
import os
|
||||||
|
import subprocess
|
||||||
from setuptools import (
|
from setuptools import (
|
||||||
Extension,
|
Extension,
|
||||||
setup,
|
setup,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
versions_output_text = subprocess.check_output(
|
||||||
|
['pip', 'freeze', '--all', '-qq'],
|
||||||
|
universal_newlines=True,
|
||||||
|
)
|
||||||
|
versions = versions_output_text.strip().splitlines()
|
||||||
|
|
||||||
|
# `versions` now looks like:
|
||||||
|
# ['pip==x.x.x', 'setuptools==x.x.x', 'wheel==x.x.x']
|
||||||
|
|
||||||
|
for package_name in ['pip', 'setuptools', 'wheel']:
|
||||||
|
env_name = 'EXPECTED_{}_VERSION'.format(package_name.upper())
|
||||||
|
expected_version = os.environ[env_name]
|
||||||
|
|
||||||
|
assert '{}}=={}'.format(package_name, expected_version) in versions
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="spam",
|
name="spam",
|
||||||
ext_modules=[Extension('spam', sources=['spam.c'])],
|
ext_modules=[Extension('spam', sources=['spam.c'])],
|
||||||
|
|||||||
Reference in New Issue
Block a user