diff --git a/scripts/check_site_content.sh b/scripts/check_site_content.sh deleted file mode 100755 index cd429bb..0000000 --- a/scripts/check_site_content.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# Verifies the built homepage links to every modern-python project. -set -euo pipefail - -HTML="site/index.html" -test -f "$HTML" || { echo "MISSING $HTML — run 'uv run mkdocs build' first"; exit 1; } - -REPOS=( - fastapi-sqlalchemy-template litestar-sqlalchemy-template chat-app - modern-di that-depends - lite-bootstrap httpware jwks-client faststream-redis-timers - faststream-concurrent-aiokafka faststream-outbox - db-retry eof-fixer release-scope semvertag -) - -missing=0 -for r in "${REPOS[@]}"; do - if ! grep -q "github.com/modern-python/${r}\"" "$HTML"; then - echo "MISSING LINK: $r" - missing=1 - fi -done - -if [ "$missing" -eq 0 ]; then - echo "ALL ${#REPOS[@]} PROJECT LINKS PRESENT" -else - exit 1 -fi diff --git a/tests/test_site.py b/tests/test_site.py index c17b029..718fb65 100644 --- a/tests/test_site.py +++ b/tests/test_site.py @@ -1,5 +1,8 @@ +import re from pathlib import Path +from brand.build import projects as p + _INDEX = Path(__file__).parent.parent / "docs" / "index.md" @@ -12,3 +15,21 @@ def test_home_page_supplies_its_own_h1() -> None: decoration — and the site quietly grows a "Modern Python" heading above it. """ assert " None: + """INVARIANT: the repos in the org site's project lists are exactly the repos in + `projects.py::MANIFEST` minus the `modern-di-*` integrations. + + It is the site's half of the profile-row invariant. A hand-kept list of expected + repos drifts the same way the page does, so a repo added to the org and the profile + can still be missing here without anything failing. + """ + listed = set( + re.findall( + r"^- \[`([^`]+)`\]\(https://github\.com/modern-python/\1\)", + _INDEX.read_text(encoding="utf-8"), + flags=re.M, + ) + ) + assert listed == {repo for repo in p.MANIFEST if not repo.startswith("modern-di-")}