Skip to content

Commit 9c20805

Browse files
committed
lint and fix comment
1 parent cc79c8a commit 9c20805

File tree

3 files changed

+34
-24
lines changed

3 files changed

+34
-24
lines changed

src/auditwheel/main_repair.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def execute(args, p):
111111

112112
# Split comma separated values and flatten it
113113
exclude = frozenset(
114-
item.strip() for sublist in args.EXCLUDE for item in sublist.split(',')
114+
item.strip() for sublist in args.EXCLUDE for item in sublist.split(",")
115115
)
116116

117117
wheel_policy = WheelPolicies()

tests/integration/test_manylinux.py

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -330,27 +330,33 @@ def test_repair_exclude(self, any_manylinux_container, io_folder):
330330
assert "manylinux" not in orig_wheel
331331

332332
def run_repair_test(exclude_args, expected_exclusions):
333-
repair_command = [
334-
f"LD_LIBRARY_PATH={test_path}/a:$LD_LIBRARY_PATH",
335-
"auditwheel",
336-
"repair",
337-
f"--plat={policy}",
338-
"--only-plat",
339-
"-w",
340-
"/io",
341-
] + exclude_args + [
342-
f"/io/{orig_wheel}",
343-
]
344-
output = docker_exec(manylinux_ctr, ["bash", "-c", " ".join(repair_command)])
333+
repair_command = (
334+
[
335+
f"LD_LIBRARY_PATH={test_path}/a:$LD_LIBRARY_PATH",
336+
"auditwheel",
337+
"repair",
338+
f"--plat={policy}",
339+
"--only-plat",
340+
"-w",
341+
"/io",
342+
]
343+
+ exclude_args
344+
+ [
345+
f"/io/{orig_wheel}",
346+
]
347+
)
348+
output = docker_exec(
349+
manylinux_ctr, ["bash", "-c", " ".join(repair_command)]
350+
)
345351

346352
# Check for exclusions in the output
347353
for arg in exclude_args:
348-
if ',' in arg:
349-
libs = arg.split('=')[1].split(',')
354+
if "," in arg:
355+
libs = arg.split("=")[1].split(",")
350356
for lib in libs:
351357
assert f"Excluding {lib}" in output
352358
else:
353-
lib = arg.split('=')[1]
359+
lib = arg.split("=")[1]
354360
assert f"Excluding {lib}" in output
355361

356362
filenames = os.listdir(io_folder)
@@ -359,14 +365,21 @@ def run_repair_test(exclude_args, expected_exclusions):
359365
assert repaired_wheel in filenames
360366

361367
# Make sure we don't have the excluded libraries in the result
362-
contents = zipfile.ZipFile(os.path.join(io_folder, repaired_wheel)).namelist()
368+
contents = zipfile.ZipFile(
369+
os.path.join(io_folder, repaired_wheel)
370+
).namelist()
363371
for lib in expected_exclusions:
364372
assert not any(x for x in contents if f"/{lib}" in x)
365373

366-
# Test case 1: Exclude liba.so only - it will exclude libb.so as well due to indirect reference
367-
run_repair_test(["--exclude=liba.so", "--exclude=libx.so"], ["liba.so", "libb.so", "libx.so"])
374+
# Test case 1: Exclude liba.so and libx.so using 2 --exclude parameters
375+
run_repair_test(
376+
["--exclude=liba.so", "--exclude=libx.so"],
377+
["liba.so", "libb.so", "libx.so"],
378+
)
368379
# Test case 2: Exclude liba.so and libx.so using comma separated
369-
run_repair_test(["--exclude=liba.so,libx.so"], ["liba.so", "libb.so", "libx.so"])
380+
run_repair_test(
381+
["--exclude=liba.so,libx.so"], ["liba.so", "libb.so", "libx.so"]
382+
)
370383

371384
def test_build_wheel_with_binary_executable(
372385
self, any_manylinux_container, docker_python, io_folder

tests/integration/testrpath/setup.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ def run(self) -> None:
4343
include_dirs=["a", "x"],
4444
libraries=["a", "x"],
4545
library_dirs=["a", "x"],
46-
extra_link_args=[
47-
'-Wl,-rpath,$ORIGIN/../a',
48-
'-Wl,-rpath,$ORIGIN/../x'
49-
],
46+
extra_link_args=["-Wl,-rpath,$ORIGIN/../a", "-Wl,-rpath,$ORIGIN/../x"],
5047
)
5148
],
5249
)

0 commit comments

Comments
 (0)