Skip to content

Commit 8949783

Browse files
committed
chore: move blacklisted symbol test to a bundled wheel
1 parent 4cec26a commit 8949783

6 files changed

Lines changed: 41 additions & 94 deletions

File tree

tests/integration/test_bundled_wheels.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,44 @@ def test_weak_symbols_not_blacklisted() -> None:
277277
assert result.policies.libc == Libc.GLIBC
278278
assert result.policies.architecture == Architecture.x86_64
279279
assert result.overall_policy.name == "manylinux_2_17_x86_64"
280+
281+
282+
def test_symbol_blacklist(
283+
monkeypatch: pytest.MonkeyPatch,
284+
capsys: pytest.CaptureFixture[str],
285+
) -> None:
286+
# wheel built using main@dda40c214e3db607b6ab31cd4cf9e3e5e1347937
287+
# AUDITWHEEL_ARCH=x86_64 nox -s tests-3.10 -- \
288+
# 'tests/integration/test_manylinux.py::TestManylinux::test_zlib_blacklist[manylinux_2_12]'
289+
wheel = HERE / "testzlib-0.0.1-cp310-cp310-linux_x86_64.whl"
290+
result = analyze_wheel_abi(
291+
None,
292+
None,
293+
wheel,
294+
frozenset(),
295+
disable_isa_ext_check=False,
296+
allow_graft=False,
297+
)
298+
assert result.policies.libc == Libc.GLIBC
299+
assert result.policies.architecture == Architecture.x86_64
300+
assert result.overall_policy.name == "linux_x86_64"
301+
assert result.blacklist_policy.name == "linux_x86_64"
302+
assert result.sym_policy.name == "manylinux_2_12_x86_64"
303+
assert result.graft_policy.name == "manylinux_2_5_x86_64"
304+
assert result.machine_policy.name == "manylinux_2_5_x86_64"
305+
assert result.pyfpe_policy.name == "manylinux_2_5_x86_64"
306+
assert result.ref_policy.name == "manylinux_2_5_x86_64"
307+
assert result.ucs_policy.name == "manylinux_2_5_x86_64"
308+
309+
monkeypatch.setattr(sys, "platform", "linux")
310+
monkeypatch.setattr(Architecture, "detect", lambda: Architecture.x86_64)
311+
monkeypatch.setattr(sys, "argv", ["auditwheel", "repair", str(wheel)])
312+
with pytest.raises(SystemExit):
313+
main()
314+
captured = capsys.readouterr()
315+
assert " because it depends on black-listed symbols" in captured.err.replace("\n", " ")
316+
317+
monkeypatch.setattr(sys, "argv", ["auditwheel", "-v", "show", str(wheel)])
318+
main()
319+
captured = capsys.readouterr()
320+
assert "black-listed symbol dependencies" in captured.out.replace("\n", " ")

tests/integration/test_manylinux.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,32 +1195,6 @@ def test_mvec(self, anylinux: AnyLinuxContainer, python: PythonContainer) -> Non
11951195
# Test the resulting wheel outside the manylinux container
11961196
python.install_wheel(repaired_wheel)
11971197

1198-
def test_zlib_blacklist(self, anylinux: AnyLinuxContainer) -> None:
1199-
policy = anylinux.policy
1200-
if policy.startswith(
1201-
(
1202-
"manylinux_2_17_",
1203-
"manylinux_2_28_",
1204-
"manylinux_2_31_",
1205-
"manylinux_2_34_",
1206-
"manylinux_2_35_",
1207-
"manylinux_2_39_",
1208-
),
1209-
):
1210-
pytest.skip(f"{policy} image has no blacklist symbols in libz.so.1")
1211-
1212-
test_path = "/auditwheel_src/tests/integration/testzlib"
1213-
orig_wheel = anylinux.build_wheel(test_path)
1214-
assert orig_wheel.startswith("testzlib-0.0.1")
1215-
1216-
# Repair the wheel using the appropriate manylinux container
1217-
with pytest.raises(CalledProcessError):
1218-
anylinux.repair(orig_wheel)
1219-
1220-
# Check auditwheel show warns about the black listed symbols
1221-
output = anylinux.show(orig_wheel, verbose=True)
1222-
assert "black-listed symbol dependencies" in output.replace("\n", " ")
1223-
12241198
@pytest.mark.skipif(PLATFORM != "aarch64", reason="glibc blacklist only for aarch64")
12251199
def test_glibc_blacklist(self, anylinux: AnyLinuxContainer, python: PythonContainer) -> None:
12261200
# https://github.com/pypa/auditwheel/issues/647
13.1 KB
Binary file not shown.

tests/integration/testzlib/pyproject.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/integration/testzlib/setup.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

tests/integration/testzlib/testzlib.c

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)