Skip to content

Commit

Permalink
switch to python script with GH markdown formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Titus-von-Koeller committed Mar 7, 2024
1 parent 0de046c commit 012e61a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,7 @@ jobs:
run: python -m build .
- name: Show auditwheel information
if: matrix.os == 'ubuntu-latest'
run: |
pip install -q auditwheel
for whl in dist/*.whl; do
printf '%.0s=' {1..60} # separator line, same as below
echo -e "\nChecking wheel: $whl"
printf '%.0s-' {1..60}
echo
auditwheel show "$whl"
printf '%.0s-' {1..60}
echo
done
run: pip install -q auditwheel && python ./scripts/auditwheel_show.py
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
Expand Down
29 changes: 29 additions & 0 deletions scripts/auditwheel_show.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import glob
import os
import subprocess


def append_to_summary(content):
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")

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

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")

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")

0 comments on commit 012e61a

Please sign in to comment.