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',
|
||||
'setuptools': '43.0.0',
|
||||
'wheel': '0.33.6',
|
||||
'virtualenv': '16.7.8',
|
||||
}
|
||||
|
||||
constraints_file = tmp_path / 'constraints.txt'
|
||||
@@ -104,6 +105,7 @@ def test_dependency_constraints_file(tmp_path):
|
||||
pip=={pip}
|
||||
setuptools=={setuptools}
|
||||
wheel=={wheel}
|
||||
virtualenv=={virtualenv}
|
||||
'''.format(**tool_versions)
|
||||
))
|
||||
|
||||
|
||||
@@ -1,8 +1,25 @@
|
||||
import os
|
||||
import subprocess
|
||||
from setuptools import (
|
||||
Extension,
|
||||
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(
|
||||
name="spam",
|
||||
ext_modules=[Extension('spam', sources=['spam.c'])],
|
||||
|
||||
Reference in New Issue
Block a user