Skip to content

Commit b329be3

Browse files
committed
add test with statically linked script
1 parent 79ca351 commit b329be3

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,6 @@ wheelhoust-*
6565
tests/integration/testpackage/testpackage/testprogram
6666
tests/integration/testpackage/testpackage/testprogram_nodeps
6767
tests/integration/sample_extension/src/sample_extension.c
68+
69+
# Downloaded by test script
70+
tests/integration/patchelf-0.17.2.1-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.musllinux_1_1_x86_64.whl

Diff for: noxfile.py

+14
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,21 @@ def tests(session: nox.Session) -> None:
6262
"""
6363
posargs = session.posargs
6464
extras = "coverage" if RUNNING_CI else "test"
65+
session.install("-U", "pip")
6566
session.install("-e", f".[{extras}]")
67+
# for tests/integration/test_bundled_wheels.py::test_analyze_wheel_abi_static_exe
68+
session.run(
69+
"pip",
70+
"download",
71+
"--only-binary",
72+
":all:",
73+
"--no-deps",
74+
"--platform",
75+
"manylinux1_x86_64",
76+
"-d",
77+
"./tests/integration/",
78+
"patchelf==0.17.2.1",
79+
)
6680
if RUNNING_CI:
6781
posargs.extend(["--cov", "auditwheel", "--cov-branch"])
6882
# pull manylinux images that will be used.

Diff for: tests/integration/test_bundled_wheels.py

+21
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,27 @@ def test_analyze_wheel_abi_bad_architecture():
117117
)
118118

119119

120+
def test_analyze_wheel_abi_static_exe(caplog):
121+
result = analyze_wheel_abi(
122+
None,
123+
None,
124+
HERE
125+
/ "patchelf-0.17.2.1-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.musllinux_1_1_x86_64.whl",
126+
frozenset(),
127+
False,
128+
False,
129+
)
130+
assert "setting architecture to x86_64" in caplog.text
131+
assert "couldn't detect wheel libc, defaulting to" in caplog.text
132+
assert result.policies.architecture == Architecture.x86_64
133+
if Libc.detect() == Libc.MUSL:
134+
assert result.policies.libc == Libc.MUSL
135+
assert result.overall_policy.name.startswith("musllinux_1_")
136+
else:
137+
assert result.policies.libc == Libc.GLIBC
138+
assert result.overall_policy.name == "manylinux_2_5_x86_64"
139+
140+
120141
@pytest.mark.skipif(platform.machine() != "x86_64", reason="only checked on x86_64")
121142
def test_wheel_source_date_epoch(tmp_path, monkeypatch):
122143
wheel_build_path = tmp_path / "wheel"

0 commit comments

Comments
 (0)