From 0dc4b6c5dc41339a0c5982ae6fda2ed1631bd736 Mon Sep 17 00:00:00 2001 From: Magnus Hedemark Date: Fri, 14 Aug 2026 23:42:25 -0400 Subject: [PATCH] fix(ci): pin epub test deps and surface epublib skip Pin the epub skill's test-only dependencies (EbookLib, beautifulsoup4) with exact versions in requirements-epub-test.txt and install from that file in CI, instead of unpinned package names. The file is test-only and notes that EbookLib is AGPL; requirements-dev.txt is untouched. Also surface the epublib skip in epub/scripts/test_epub_skill.sh: when epublib is not importable (it requires Python 3.13+), epub-edit and epub-convert now print an explicit SKIPPED line and count as SKIP in the summary instead of silently passing. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- .github/workflows/validate.yml | 2 +- epub/scripts/test_epub_skill.sh | 13 +++++++++---- requirements-epub-test.txt | 3 +++ scripts/check-skill-tests.py | 6 ++++-- 4 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 requirements-epub-test.txt diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index a5de9db..ddcb9c7 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -78,7 +78,7 @@ jobs: python3 -m pytest "$dir" -o "addopts=-ra --strict-markers --tb=short" -o "python_files=test_*.py" -v --durations=10 done < <(git ls-files | grep -E '/scripts/test_[^/]*\.py$' | sed 's#/[^/]*$##' | sort -u) - name: Install epub skill test deps (EbookLib is AGPL; test-only) - run: python3 -m pip install EbookLib beautifulsoup4 + run: python3 -m pip install -r requirements-epub-test.txt - name: Run skill-local shell test scripts run: python3 scripts/check-skill-tests.py --run - name: Check skill test coverage diff --git a/epub/scripts/test_epub_skill.sh b/epub/scripts/test_epub_skill.sh index 14fda02..2734f70 100755 --- a/epub/scripts/test_epub_skill.sh +++ b/epub/scripts/test_epub_skill.sh @@ -7,6 +7,7 @@ SKILL_DIR="$(cd "$(dirname "$0")/.." && pwd)" SCRIPTS="$SKILL_DIR/scripts" PASS=0 FAIL=0 +SKIP=0 TMPDIR=$(mktemp -d) TEST_EPUB="$TMPDIR/test-book.epub" @@ -25,6 +26,11 @@ pass() { PASS=$((PASS + 1)) } +skip() { + echo " SKIPPED: $1" + SKIP=$((SKIP + 1)) +} + # ═══════════════════════════════════════════════════════ # 1. epub-scaffold — create a valid test EPUB # ═══════════════════════════════════════════════════════ @@ -307,8 +313,7 @@ if python3 -c "import epublib" 2>/dev/null; then fail "edit metadata: exits non-zero" fi else - pass "edit: epublib not installed — skipping" - pass "edit metadata: epublib not installed — skipping" + skip "epub-edit (requires epublib; Python 3.13+)" fi # Test dry-run on metadata (works without epublib) @@ -368,7 +373,7 @@ if python3 -c "import epublib" 2>/dev/null; then fail "convert: exits non-zero" fi else - pass "convert: epublib not installed — skipping" + skip "epub-convert (requires epublib; Python 3.13+)" fi CONVERT_OUT="$TMPDIR/converted.epub" # always set @@ -452,7 +457,7 @@ done # ═══════════════════════════════════════════════════════ echo "" echo "═══════════════════════════════════════" -echo " PASS: $PASS FAIL: $FAIL TOTAL: $((PASS + FAIL))" +echo " PASS: $PASS FAIL: $FAIL SKIP: $SKIP TOTAL: $((PASS + FAIL + SKIP))" echo "═══════════════════════════════════════" if [ "$FAIL" -gt 0 ]; then diff --git a/requirements-epub-test.txt b/requirements-epub-test.txt new file mode 100644 index 0000000..4fcfe33 --- /dev/null +++ b/requirements-epub-test.txt @@ -0,0 +1,3 @@ +# epub-skill test-only deps (not in requirements-dev.txt); EbookLib is AGPL. +EbookLib==0.20.0 +beautifulsoup4==4.15.0 diff --git a/scripts/check-skill-tests.py b/scripts/check-skill-tests.py index 30d2b64..47e5818 100644 --- a/scripts/check-skill-tests.py +++ b/scripts/check-skill-tests.py @@ -36,8 +36,10 @@ RUN_TESTS: list[tuple[str, list[str]]] = [ ("data-scientist/scripts/test_detect_compute.sh", ["--local"]), ("brand-designer/scripts/brand-book_test.sh", []), ("flaresolverr/scripts/test-flaresolverr.sh", []), - # Requires EbookLib (AGPL) and beautifulsoup4, installed test-only in CI - # before this script runs. + # Requires EbookLib (AGPL) and beautifulsoup4 (installed test-only in CI + # before this script runs); epub-edit/epub-convert additionally require + # epublib (Python 3.13+) and are skipped, and surfaced as skips, on the + # Python 3.12 CI runner. ("epub/scripts/test_epub_skill.sh", []), ]