From 179148b0e528f56dce6b499a4432e26084f8c903 Mon Sep 17 00:00:00 2001 From: Yannick Jadoul Date: Tue, 27 Aug 2019 16:03:09 +0200 Subject: [PATCH] Updated preset values for CIBW_MANYLINUX_*_IMAGE, fixed skip message in 08_manylinux2010_only test, and added clarifying comment on multiple wheels in Linux bash script --- cibuildwheel/__main__.py | 9 ++++++--- cibuildwheel/linux.py | 5 +++++ test/06_docker_images/cibuildwheel_test.py | 4 ++-- test/08_manylinux2010_only/cibuildwheel_test.py | 2 +- test/shared/utils.py | 8 ++++---- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py index 68c3ff65..0ad6b425 100644 --- a/cibuildwheel/__main__.py +++ b/cibuildwheel/__main__.py @@ -147,9 +147,12 @@ def main(): manylinux_x86_64_image = os.environ.get('CIBW_MANYLINUX_X86_64_IMAGE', '2010') manylinux_i686_image = os.environ.get('CIBW_MANYLINUX_I686_IMAGE', '') - default_manylinux_images_x86_64 = {'1': 'quay.io/pypa/manylinux1_x86_64', - '2010': 'quay.io/pypa/manylinux2010_x86_64'} - default_manylinux_images_i686 = {'1': 'quay.io/pypa/manylinux1_i686'} + manylinux_x86_64_image = os.environ.get('CIBW_MANYLINUX_X86_64_IMAGE', 'manylinux2010') + manylinux_i686_image = os.environ.get('CIBW_MANYLINUX_I686_IMAGE', '') + + default_manylinux_images_x86_64 = {'manylinux1': 'quay.io/pypa/manylinux1_x86_64', + 'manylinux2010': 'quay.io/pypa/manylinux2010_x86_64'} + default_manylinux_images_i686 = {'manylinux1': 'quay.io/pypa/manylinux1_i686'} build_options.update( manylinux_images={'x86_64': default_manylinux_images_x86_64.get(manylinux_x86_64_image) or manylinux_x86_64_image, diff --git a/cibuildwheel/linux.py b/cibuildwheel/linux.py index 573a150c..84b16e48 100644 --- a/cibuildwheel/linux.py +++ b/cibuildwheel/linux.py @@ -102,6 +102,11 @@ def build(project_dir, output_dir, test_command, test_requires, test_extras, bef echo "Running tests using `which python`" # Install the wheel we just built + # Note: If auditwheel produced two wheels, it's because the earlier produced wheel + # conforms to multiple manylinux standards. These multiple versions of the wheel are + # functionally the same, differing only in name, wheel metadata, and possibly include + # different external shared libraries. so it doesn't matter which one we run the tests on. + # Let's just pick the first one. pip install "${{delocated_wheels[0]}}"{test_extras} # Install any requirements to run the tests diff --git a/test/06_docker_images/cibuildwheel_test.py b/test/06_docker_images/cibuildwheel_test.py index fda6ed49..c586151b 100644 --- a/test/06_docker_images/cibuildwheel_test.py +++ b/test/06_docker_images/cibuildwheel_test.py @@ -5,7 +5,7 @@ def test(): project_dir = os.path.dirname(__file__) if utils.platform != 'linux': - pytest.skip('the docker test is only relevant to the linux build') + pytest.skip('the test is only relevant to the linux build') utils.cibuildwheel_run(project_dir, add_env={ 'CIBW_MANYLINUX_X86_64_IMAGE': 'dockcross/manylinux2010-x64', @@ -15,6 +15,6 @@ def test(): }) # also check that we got the right wheels built - expected_wheels = utils.expected_wheels('spam', '0.1.0', manylinux_versions={'1_x86_64', '2010_x86_64', '1_i686'}) + expected_wheels = utils.expected_wheels('spam', '0.1.0', manylinux_versions={'manylinux1_x86_64', 'manylinux2010_x86_64', 'manylinux1_i686'}) actual_wheels = os.listdir('wheelhouse') assert set(actual_wheels) == set(expected_wheels) diff --git a/test/08_manylinux2010_only/cibuildwheel_test.py b/test/08_manylinux2010_only/cibuildwheel_test.py index 392ec459..814a364b 100644 --- a/test/08_manylinux2010_only/cibuildwheel_test.py +++ b/test/08_manylinux2010_only/cibuildwheel_test.py @@ -15,6 +15,6 @@ def test(): }) # also check that we got the right wheels - expected_wheels = utils.expected_wheels('spam', '0.1.0', manylinux_versions={'2010_x86_64'}) + expected_wheels = utils.expected_wheels('spam', '0.1.0', manylinux_versions={'manylinux2010_x86_64'}) actual_wheels = os.listdir('wheelhouse') assert set(actual_wheels) == set(expected_wheels) diff --git a/test/shared/utils.py b/test/shared/utils.py index 63f4c557..d4ea60a5 100644 --- a/test/shared/utils.py +++ b/test/shared/utils.py @@ -42,13 +42,13 @@ def cibuildwheel_run(project_path, env=None, add_env=None): ) -def expected_wheels(package_name, package_version, manylinux_versions={'1_x86_64', '2010_x86_64'}): +def expected_wheels(package_name, package_version, manylinux_versions={'manylinux1_x86_64', 'manylinux2010_x86_64'}): ''' Returns a list of expected wheels from a run of cibuildwheel. ''' if platform == 'linux': templates = [] - if '1_x86_64' in manylinux_versions: + if 'manylinux1_x86_64' in manylinux_versions: templates += [ '{package_name}-{package_version}-cp27-cp27m-manylinux1_x86_64.whl', '{package_name}-{package_version}-cp27-cp27mu-manylinux1_x86_64.whl', @@ -57,7 +57,7 @@ def expected_wheels(package_name, package_version, manylinux_versions={'1_x86_64 '{package_name}-{package_version}-cp36-cp36m-manylinux1_x86_64.whl', '{package_name}-{package_version}-cp37-cp37m-manylinux1_x86_64.whl', ] - if '1_i686' in manylinux_versions: + if 'manylinux1_i686' in manylinux_versions: templates += [ '{package_name}-{package_version}-cp27-cp27m-manylinux1_i686.whl', '{package_name}-{package_version}-cp27-cp27mu-manylinux1_i686.whl', @@ -66,7 +66,7 @@ def expected_wheels(package_name, package_version, manylinux_versions={'1_x86_64 '{package_name}-{package_version}-cp36-cp36m-manylinux1_i686.whl', '{package_name}-{package_version}-cp37-cp37m-manylinux1_i686.whl', ] - if '2010_x86_64' in manylinux_versions: + if 'manylinux2010_x86_64' in manylinux_versions: templates += [ '{package_name}-{package_version}-cp27-cp27m-manylinux2010_x86_64.whl', '{package_name}-{package_version}-cp27-cp27mu-manylinux2010_x86_64.whl',