Skip to content

Commit

Permalink
test: update expected wheels when using auditwheel >= 4
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut committed May 8, 2021
1 parent d21c540 commit d318038
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
13 changes: 1 addition & 12 deletions test/test_0_basic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import platform
import textwrap

import pytest
Expand Down Expand Up @@ -53,16 +52,6 @@ def test_build_identifiers(tmp_path):

# check that the number of expected wheels matches the number of build
# identifiers
# after adding CIBW_MANYLINUX_IMAGE to support manylinux2010, there
# can be multiple wheels for each wheel, though, so we need to limit
# the expected wheels
if platform.machine() in ["x86_64", "i686"]:
expected_wheels = [
w
for w in utils.expected_wheels("spam", "0.1.0")
if "-manylinux" not in w or "-manylinux1" in w
]
else:
expected_wheels = utils.expected_wheels("spam", "0.1.0")
expected_wheels = utils.expected_wheels("spam", "0.1.0")
build_identifiers = utils.cibuildwheel_get_build_identifiers(project_dir)
assert len(expected_wheels) == len(build_identifiers)
8 changes: 7 additions & 1 deletion test/test_docker_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ def test(tmp_path):
)

# also check that we got the right wheels built
# there's no auditwheel 4+ on dockcross image
# remove manylinux1 wheels from the list of actual_wheels
# and restrict expected_wheels to manylinux2010 wheels
actual_wheels = [w for w in actual_wheels if "-manylinux1" not in w]
expected_wheels = [
w for w in utils.expected_wheels("spam", "0.1.0") if "-pp" not in w and "-cp39-" not in w
w
for w in utils.expected_wheels("spam", "0.1.0", manylinux_versions=["manylinux2010"])
if "-pp" not in w and "-cp39-" not in w
]
assert set(actual_wheels) == set(expected_wheels)
11 changes: 8 additions & 3 deletions test/test_manylinuxXXXX_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,14 @@ def test(manylinux_image, tmp_path):

actual_wheels = utils.cibuildwheel_run(project_dir, add_env=add_env)

expected_wheels = [
w for w in utils.expected_wheels("spam", "0.1.0", manylinux_versions=[manylinux_image])
]
platform_tag_map = {
"manylinux1": ["manylinux_2_5", "manylinux1"],
"manylinux2010": ["manylinux_2_12", "manylinux2010"],
"manylinux2014": ["manylinux_2_17", "manylinux2014"],
}
expected_wheels = utils.expected_wheels(
"spam", "0.1.0", manylinux_versions=platform_tag_map.get(manylinux_image, [manylinux_image])
)
if manylinux_image in {"manylinux1", "manylinux2014", "manylinux_2_24"}:
expected_wheels = [w for w in expected_wheels if "-pp" not in w]
assert set(actual_wheels) == set(expected_wheels)
12 changes: 8 additions & 4 deletions test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ def expected_wheels(

if manylinux_versions is None:
if machine_arch == "x86_64":
manylinux_versions = ["manylinux1", "manylinux2010"]
manylinux_versions = ["manylinux_2_5", "manylinux1", "manylinux_2_12", "manylinux2010"]
else:
manylinux_versions = ["manylinux2014"]
manylinux_versions = ["manylinux_2_17", "manylinux2014"]

python_abi_tags = ["cp36-cp36m", "cp37-cp37m", "cp38-cp38", "cp39-cp39"]

Expand Down Expand Up @@ -144,9 +144,13 @@ def expected_wheels(
architectures.append("i686")

platform_tags = [
f"{manylinux_version}_{architecture}"
".".join(
[
f"{manylinux_version}_{architecture}"
for manylinux_version in manylinux_versions
]
)
for architecture in architectures
for manylinux_version in manylinux_versions
]

elif platform == "windows":
Expand Down

0 comments on commit d318038

Please sign in to comment.