Skip to content

Commit

Permalink
When repairing a pure python wheel, exit code should be 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben DI BATTISTA committed Jul 17, 2023
1 parent 90d382e commit c57b1df
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/auditwheel/main_addtag.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def execute(args, p):
wheel_abi = analyze_wheel_abi(args.WHEEL_FILE)
except NonPlatformWheel:
logger.info(NonPlatformWheel.LOG_MESSAGE)
return 1
return 0

parsed_fname = WHEEL_INFO_RE.search(basename(args.WHEEL_FILE))
in_fname_tags = parsed_fname.groupdict()["plat"].split(".")
Expand Down
2 changes: 1 addition & 1 deletion src/auditwheel/main_repair.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def execute(args, p):
wheel_abi = analyze_wheel_abi(wheel_file)
except NonPlatformWheel:
logger.info(NonPlatformWheel.LOG_MESSAGE)
return 1
return 0

policy = get_policy_by_name(args.PLAT)
reqd_tag = policy["priority"]
Expand Down
2 changes: 1 addition & 1 deletion src/auditwheel/main_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def execute(args, p):
winfo = analyze_wheel_abi(args.WHEEL_FILE)
except NonPlatformWheel:
logger.info(NonPlatformWheel.LOG_MESSAGE)
return 1
return 0

libs_with_versions = [
f"{k} with versions {v}" for k, v in winfo.versioned_symbols.items()
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_manylinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,11 @@ def test_build_repair_pure_wheel(self, any_manylinux_container, io_folder):

# Repair the wheel using the manylinux container
repair_command = f"auditwheel repair --plat {policy} -w /io /io/{orig_wheel}"
output = docker_exec(manylinux_ctr, repair_command, expected_retcode=1)
output = docker_exec(manylinux_ctr, repair_command, expected_retcode=0)
assert "This does not look like a platform wheel" in output

output = docker_exec(
manylinux_ctr, f"auditwheel show /io/{orig_wheel}", expected_retcode=1
manylinux_ctr, f"auditwheel show /io/{orig_wheel}", expected_retcode=0
)
assert "This does not look like a platform wheel" in output

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_nonplatform_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ def test_non_platform_wheel_repair(mode):
stderr=subprocess.PIPE,
text=True,
)
assert proc.returncode == 1
assert proc.returncode == 0
assert "This does not look like a platform wheel" in proc.stderr
assert "AttributeError" not in proc.stderr

0 comments on commit c57b1df

Please sign in to comment.