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>
This commit is contained in:
Magnus Hedemark
2026-08-14 23:42:25 -04:00
co-authored by factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
parent b24f8a8d98
commit 0dc4b6c5dc
4 changed files with 17 additions and 7 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ jobs:
python3 -m pytest "$dir" -o "addopts=-ra --strict-markers --tb=short" -o "python_files=test_*.py" -v --durations=10 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) done < <(git ls-files | grep -E '/scripts/test_[^/]*\.py$' | sed 's#/[^/]*$##' | sort -u)
- name: Install epub skill test deps (EbookLib is AGPL; test-only) - 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 - name: Run skill-local shell test scripts
run: python3 scripts/check-skill-tests.py --run run: python3 scripts/check-skill-tests.py --run
- name: Check skill test coverage - name: Check skill test coverage
+9 -4
View File
@@ -7,6 +7,7 @@ SKILL_DIR="$(cd "$(dirname "$0")/.." && pwd)"
SCRIPTS="$SKILL_DIR/scripts" SCRIPTS="$SKILL_DIR/scripts"
PASS=0 PASS=0
FAIL=0 FAIL=0
SKIP=0
TMPDIR=$(mktemp -d) TMPDIR=$(mktemp -d)
TEST_EPUB="$TMPDIR/test-book.epub" TEST_EPUB="$TMPDIR/test-book.epub"
@@ -25,6 +26,11 @@ pass() {
PASS=$((PASS + 1)) PASS=$((PASS + 1))
} }
skip() {
echo " SKIPPED: $1"
SKIP=$((SKIP + 1))
}
# ═══════════════════════════════════════════════════════ # ═══════════════════════════════════════════════════════
# 1. epub-scaffold — create a valid test EPUB # 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" fail "edit metadata: exits non-zero"
fi fi
else else
pass "edit: epublib not installed — skipping" skip "epub-edit (requires epublib; Python 3.13+)"
pass "edit metadata: epublib not installed — skipping"
fi fi
# Test dry-run on metadata (works without epublib) # 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" fail "convert: exits non-zero"
fi fi
else else
pass "convert: epublib not installed — skipping" skip "epub-convert (requires epublib; Python 3.13+)"
fi fi
CONVERT_OUT="$TMPDIR/converted.epub" # always set CONVERT_OUT="$TMPDIR/converted.epub" # always set
@@ -452,7 +457,7 @@ done
# ═══════════════════════════════════════════════════════ # ═══════════════════════════════════════════════════════
echo "" echo ""
echo "═══════════════════════════════════════" echo "═══════════════════════════════════════"
echo " PASS: $PASS FAIL: $FAIL TOTAL: $((PASS + FAIL))" echo " PASS: $PASS FAIL: $FAIL SKIP: $SKIP TOTAL: $((PASS + FAIL + SKIP))"
echo "═══════════════════════════════════════" echo "═══════════════════════════════════════"
if [ "$FAIL" -gt 0 ]; then if [ "$FAIL" -gt 0 ]; then
+3
View File
@@ -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
+4 -2
View File
@@ -36,8 +36,10 @@ RUN_TESTS: list[tuple[str, list[str]]] = [
("data-scientist/scripts/test_detect_compute.sh", ["--local"]), ("data-scientist/scripts/test_detect_compute.sh", ["--local"]),
("brand-designer/scripts/brand-book_test.sh", []), ("brand-designer/scripts/brand-book_test.sh", []),
("flaresolverr/scripts/test-flaresolverr.sh", []), ("flaresolverr/scripts/test-flaresolverr.sh", []),
# Requires EbookLib (AGPL) and beautifulsoup4, installed test-only in CI # Requires EbookLib (AGPL) and beautifulsoup4 (installed test-only in CI
# before this script runs. # 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", []), ("epub/scripts/test_epub_skill.sh", []),
] ]