Skip to content

Commit

Permalink
improve script a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Titus-von-Koeller committed Mar 7, 2024
1 parent 731e2c2 commit d6b1471
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions scripts/auditwheel_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,29 @@


def append_to_summary(content):
print(content + '\n') # only for debugging now
print(content + "\n") # only for debugging now
with open(os.getenv("GITHUB_STEP_SUMMARY"), "a") as summary_file:
summary_file.write(content + "\n")


subprocess.run(["pip", "install", "-q", "auditwheel"])

wheel_files = glob.glob("dist/*.whl")
wheel_files = glob.glob("**/*.whl", recursive=True)

if not wheel_files:
append_to_summary("No wheel files found in `dist/` directory.")
exit(0)

for whl in wheel_files:
append_to_summary("---")
append_to_summary("### 🎡 Auditing wheel: `" + whl + "`\n")
append_to_summary("### 🎡 Auditing wheel: `" + whl + "`")

audit_wheel_output = subprocess.run(
["auditwheel", "show", whl], capture_output=True, text=True
)

if audit_wheel_output.stdout:
append_to_summary(audit_wheel_output.stdout + "\n")
append_to_summary(audit_wheel_output.stdout)

if audit_wheel_output.stderr:
append_to_summary("**Error:**\n```\n" + audit_wheel_output.stderr + "```\n")

append_to_summary("\n🐍 **Slithering on to the next one...** 🐍\n")
append_to_summary("**Error:**\n```\n" + audit_wheel_output.stderr + "```")

0 comments on commit d6b1471

Please sign in to comment.