Run dependency tests on pypy too, and update constraint for 3.6
This commit is contained in:
@@ -45,34 +45,34 @@ def test_pinned_versions(python_version):
|
|||||||
cibw_environment_option = ' '.join(
|
cibw_environment_option = ' '.join(
|
||||||
['{}={}'.format(k, v) for k, v in build_environment.items()]
|
['{}={}'.format(k, v) for k, v in build_environment.items()]
|
||||||
)
|
)
|
||||||
cibw_build_option = 'cp27-*' if python_version == '2.7' else 'cp3*'
|
|
||||||
|
|
||||||
# build and test the wheels
|
# build and test the wheels
|
||||||
actual_wheels = utils.cibuildwheel_run(project_dir, add_env={
|
actual_wheels = utils.cibuildwheel_run(project_dir, add_env={
|
||||||
'CIBW_BUILD': cibw_build_option,
|
'CIBW_BUILD': '[cp]p27-*' if python_version == '2.7' else '[cp]p3?-*',
|
||||||
'CIBW_ENVIRONMENT': cibw_environment_option,
|
'CIBW_ENVIRONMENT': cibw_environment_option,
|
||||||
})
|
})
|
||||||
|
|
||||||
# also check that we got the right wheels
|
# also check that we got the right wheels
|
||||||
if python_version == '2.7':
|
if python_version == '2.7':
|
||||||
expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0')
|
expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0')
|
||||||
if '-cp27' in w]
|
if '-cp27' in w or '-pp27' in w]
|
||||||
else:
|
else:
|
||||||
expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0')
|
expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0')
|
||||||
if '-cp27' not in w and '-pypy' not in w]
|
if '-cp27' not in w and '-pp27' not in w]
|
||||||
|
|
||||||
assert set(actual_wheels) == set(expected_wheels)
|
assert set(actual_wheels) == set(expected_wheels)
|
||||||
|
|
||||||
|
|
||||||
def test_dependency_constraints_file(tmp_path):
|
@pytest.mark.parametrize('python_version', ['2.7', '3.x'])
|
||||||
|
def test_dependency_constraints_file(tmp_path, python_version):
|
||||||
if utils.platform == 'linux':
|
if utils.platform == 'linux':
|
||||||
pytest.skip('linux doesn\'t pin individual tool versions, it pins manylinux images instead')
|
pytest.skip('linux doesn\'t pin individual tool versions, it pins manylinux images instead')
|
||||||
|
|
||||||
project_dir = os.path.dirname(__file__)
|
project_dir = os.path.dirname(__file__)
|
||||||
|
|
||||||
tool_versions = {
|
tool_versions = {
|
||||||
'pip': '20.0.2',
|
'pip': '20.0.1',
|
||||||
'setuptools': '44.0.0',
|
'setuptools': '44.0.0' if python_version == '2.7' else '46.0.0',
|
||||||
'wheel': '0.34.2',
|
'wheel': '0.34.2',
|
||||||
'virtualenv': '16.7.8',
|
'virtualenv': '16.7.8',
|
||||||
}
|
}
|
||||||
@@ -99,10 +99,17 @@ def test_dependency_constraints_file(tmp_path):
|
|||||||
|
|
||||||
# build and test the wheels
|
# build and test the wheels
|
||||||
actual_wheels = utils.cibuildwheel_run(project_dir, add_env={
|
actual_wheels = utils.cibuildwheel_run(project_dir, add_env={
|
||||||
|
'CIBW_BUILD': '[cp]p27-*' if python_version == '2.7' else '[cp]p3?-*',
|
||||||
'CIBW_ENVIRONMENT': cibw_environment_option,
|
'CIBW_ENVIRONMENT': cibw_environment_option,
|
||||||
'CIBW_DEPENDENCY_VERSIONS': str(constraints_file),
|
'CIBW_DEPENDENCY_VERSIONS': str(constraints_file),
|
||||||
})
|
})
|
||||||
|
|
||||||
# also check that we got the right wheels
|
# also check that we got the right wheels
|
||||||
expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0')]
|
if python_version == '2.7':
|
||||||
|
expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0')
|
||||||
|
if '-cp27' in w or '-pp27' in w]
|
||||||
|
else:
|
||||||
|
expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0')
|
||||||
|
if '-cp27' not in w and '-pp27' not in w]
|
||||||
|
|
||||||
assert set(actual_wheels) == set(expected_wheels)
|
assert set(actual_wheels) == set(expected_wheels)
|
||||||
|
|||||||
Reference in New Issue
Block a user