From f5520fa39f6edbd096ff394d89f35599002a03ab Mon Sep 17 00:00:00 2001 From: luen Date: Tue, 3 Nov 2026 13:37:04 +1000 Subject: [PATCH 1/3] ci: publish GHCR images and release aged production updates nightly --- .env.example | 3 + .github/dependency-policy.json | 3 + .github/workflows/ci.yml | 76 +++--- .github/workflows/docker-release.yml | 99 ++++++++ .github/workflows/images.yml | 71 ++++++ .../workflows/nightly-minor-deps-release.yml | 95 +++++++ AGENTS.md | 4 + Dockerfile | 6 +- README.md | 26 +- docker-compose.build.yml | 7 + docker-compose.yml | 4 +- requirements-dev.lock | 231 ++++++++++++++++++ requirements-dev.txt | 4 +- requirements.lock | 194 +++++++++++++++ requirements.txt | 6 +- scripts/dependency_release.py | 206 ++++++++++++++++ scripts/smoke_container.py | 53 ++++ tests/test_dependency_release.py | 109 +++++++++ 18 files changed, 1143 insertions(+), 54 deletions(-) create mode 100644 .github/dependency-policy.json create mode 100644 .github/workflows/docker-release.yml create mode 100644 .github/workflows/images.yml create mode 100644 .github/workflows/nightly-minor-deps-release.yml create mode 100644 docker-compose.build.yml create mode 100644 requirements-dev.lock create mode 100644 requirements.lock create mode 100644 scripts/dependency_release.py create mode 100644 scripts/smoke_container.py create mode 100644 tests/test_dependency_release.py diff --git a/.env.example b/.env.example index fd81e1e..8069b16 100644 --- a/.env.example +++ b/.env.example @@ -34,3 +34,6 @@ RUN_ON_START=0 # First run only includes items from the last N days LOOKBACK_DAYS=7 + +# latest follows published releases; set a version tag to pin/roll back. +IMAGE_TAG=latest diff --git a/.github/dependency-policy.json b/.github/dependency-policy.json new file mode 100644 index 0000000..43b31ab --- /dev/null +++ b/.github/dependency-policy.json @@ -0,0 +1,3 @@ +{ + "python": "3.12" +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e44c10..0c72dd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,48 +1,34 @@ name: CI - -permissions: - contents: read - on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - + push: + branches: [main, master] + pull_request: + branches: [main, master] + workflow_call: + inputs: + ref: + type: string + default: '' +permissions: + contents: read jobs: - lint: - name: Ruff - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - - - name: Set up Python - uses: actions/setup-python@v7.1.0 - with: - python-version: '3.12' - - - name: Install lint dependencies - run: pip install -r requirements-dev.txt - - - name: Lint - run: ruff check . - - - name: Format check - run: ruff format --check . - - test: - name: Pytest - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - - - name: Set up Python - uses: actions/setup-python@v7.1.0 - with: - python-version: '3.12' - - - name: Install dependencies - run: pip install -r requirements-dev.txt - - - name: Run tests - run: pytest -q + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + with: + ref: ${{ inputs.ref || github.ref }} + - uses: actions/setup-python@v7.1.0 + with: + python-version: '3.12' + - run: pip install uv==0.13.7 + - run: uv pip sync --system --require-hashes --exclude-newer 3d requirements-dev.lock + - run: ruff check . + - run: ruff format --check . + - run: python -m pytest tests/ + + + images: + uses: ./.github/workflows/images.yml + with: + ref: ${{ inputs.ref }} diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml new file mode 100644 index 0000000..9c9977a --- /dev/null +++ b/.github/workflows/docker-release.yml @@ -0,0 +1,99 @@ +name: Docker release + +on: + push: + tags: ['v*'] + workflow_dispatch: + inputs: + ref: + description: 'Existing stable version tag, e.g. v1.2.3' + required: true + type: string + workflow_call: + inputs: + ref: + required: true + type: string + +concurrency: + group: docker-release + cancel-in-progress: false + +permissions: + contents: read + +jobs: + tag: + runs-on: ubuntu-latest + outputs: + tag: ${{ steps.tag.outputs.tag }} + sha: ${{ steps.tag.outputs.sha }} + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + - name: Require an existing stable tag on main + id: tag + env: + TAG: ${{ inputs.ref || github.ref_name }} + run: | + set -euo pipefail + [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] + sha="$(git rev-parse --verify "refs/tags/$TAG^{commit}")" + git merge-base --is-ancestor "$sha" origin/main + echo "tag=$TAG" >> "$GITHUB_OUTPUT" + echo "sha=$sha" >> "$GITHUB_OUTPUT" + checks: + needs: tag + uses: ./.github/workflows/ci.yml + with: + ref: ${{ needs.tag.outputs.sha }} + images: + needs: [tag, checks] + uses: ./.github/workflows/images.yml + with: + ref: ${{ needs.tag.outputs.sha }} + tag: ${{ needs.tag.outputs.tag }} + publish: true + permissions: + contents: read + packages: write + publish: + needs: [tag, images] + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + steps: + - uses: docker/setup-buildx-action@v4 + - uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Assemble tested multi-platform version + env: + REPOSITORY: ${{ github.repository }} + TAG: ${{ needs.tag.outputs.tag }} + run: | + set -euo pipefail + image="ghcr.io/${REPOSITORY,,}" + for name in "$image"; do + docker buildx imagetools create --tag "$name:$TAG" "$name:$TAG-amd64" "$name:$TAG-arm64" + done + - name: Publish GitHub release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + TAG: ${{ needs.tag.outputs.tag }} + run: gh release view "$TAG" || gh release create "$TAG" --verify-tag --generate-notes + - name: Advance Watchtower latest tags + env: + REPOSITORY: ${{ github.repository }} + TAG: ${{ needs.tag.outputs.tag }} + run: | + set -euo pipefail + image="ghcr.io/${REPOSITORY,,}" + for name in "$image"; do + docker buildx imagetools create --tag "$name:latest" "$name:$TAG" + done diff --git a/.github/workflows/images.yml b/.github/workflows/images.yml new file mode 100644 index 0000000..0c90524 --- /dev/null +++ b/.github/workflows/images.yml @@ -0,0 +1,71 @@ +name: Container images + +on: + workflow_call: + inputs: + ref: + type: string + default: '' + tag: + type: string + default: smoke + publish: + type: boolean + default: false + +jobs: + images: + name: Build and smoke (${{ matrix.arch }}) + runs-on: ${{ matrix.runner }} + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + runner: ubuntu-latest + - arch: arm64 + runner: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v7 + with: + ref: ${{ inputs.ref || github.ref }} + - uses: actions/setup-python@v7.1.0 + with: + python-version: '3.12' + - uses: docker/setup-buildx-action@v4 + - name: Configure image + env: + REPOSITORY: ${{ github.repository }} + VERSION: ${{ inputs.tag }} + ARCH: ${{ matrix.arch }} + run: | + echo "IMAGE=ghcr.io/${REPOSITORY,,}" >> "$GITHUB_ENV" + echo "TAG=${VERSION}-${ARCH}" >> "$GITHUB_ENV" + - name: Validate Compose + run: | + cp .env.example .env + docker compose config --quiet + docker compose -f docker-compose.yml -f docker-compose.build.yml config --quiet + - name: Build production image + uses: docker/build-push-action@v7 + with: + context: . + load: true + tags: ${{ env.IMAGE }}:${{ env.TAG }} + labels: | + org.opencontainers.image.source=https://github.com/${{ github.repository }} + org.opencontainers.image.revision=${{ inputs.ref || github.sha }} + cache-from: type=gha,scope=image-${{ matrix.arch }} + cache-to: type=gha,scope=image-${{ matrix.arch }},mode=max + - name: Smoke test without secrets or network + run: python scripts/smoke_container.py --image "$IMAGE:$TAG" + - uses: docker/login-action@v4 + if: inputs.publish + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Push tested architecture + if: inputs.publish + run: docker push "$IMAGE:$TAG" diff --git a/.github/workflows/nightly-minor-deps-release.yml b/.github/workflows/nightly-minor-deps-release.yml new file mode 100644 index 0000000..d7d729a --- /dev/null +++ b/.github/workflows/nightly-minor-deps-release.yml @@ -0,0 +1,95 @@ +name: Nightly minor deps release + +on: + schedule: + - cron: '37 14 * * *' # Brisbane time: 00:37 + workflow_dispatch: + +concurrency: + group: nightly-minor-deps + cancel-in-progress: false + +permissions: + contents: read + +jobs: + update: + runs-on: ubuntu-latest + timeout-minutes: 60 + permissions: + contents: write + outputs: + release: ${{ steps.changes.outputs.release }} + version: ${{ steps.version.outputs.version }} + steps: + - uses: actions/checkout@v7 + with: + ref: main + fetch-depth: 0 + - name: Remember tested main + run: echo "BASE_SHA=$(git rev-parse HEAD)" >> "$GITHUB_ENV" + - uses: actions/setup-python@v7.1.0 + with: + python-version: '3.12' + - name: Install pinned resolver + run: python -m pip install uv==0.13.7 + + - name: Refresh aged in-major dependencies + id: changes + run: python scripts/dependency_release.py update + - name: Install locked validation dependencies + if: steps.changes.outputs.changed == 'true' + run: | + uv venv --python 3.12 .venv + uv pip sync --python .venv/bin/python --require-hashes --exclude-newer 3d requirements-dev.lock + - name: Validate changed dependencies + if: steps.changes.outputs.changed == 'true' + run: | + .venv/bin/ruff check . + .venv/bin/ruff format --check . + .venv/bin/python -m pytest tests/ + + - uses: docker/setup-buildx-action@v4 + if: steps.changes.outputs.release == 'true' + - name: Verify updated production image before committing + if: steps.changes.outputs.release == 'true' + run: | + docker buildx build --load -t production:smoke . + python scripts/smoke_container.py --image production:smoke + - name: Bump patch only for production changes + id: version + if: steps.changes.outputs.release == 'true' + run: python scripts/dependency_release.py bump + - name: Commit and atomically push tested dependencies + if: steps.changes.outputs.changed == 'true' + env: + RELEASE: ${{ steps.changes.outputs.release }} + VERSION: ${{ steps.version.outputs.version }} + run: | + set -euo pipefail + git fetch origin main + if [ "$(git rev-parse origin/main)" != "$BASE_SHA" ]; then + echo 'main changed during validation; refusing to release an untested rebase.' >&2 + exit 1 + fi + git config user.name 'github-actions[bot]' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + git add requirements.lock requirements-dev.lock + if [ "$RELEASE" = true ]; then + git add pyproject.toml + git commit -m "chore(deps): nightly in-major production update (v$VERSION)" + git tag "v$VERSION" + git push --atomic origin HEAD:main "refs/tags/v$VERSION" + else + git commit -m 'chore(deps): nightly tooling update (no release)' + git push origin HEAD:main + fi + docker: + needs: update + if: needs.update.outputs.release == 'true' + uses: ./.github/workflows/docker-release.yml + with: + ref: v${{ needs.update.outputs.version }} + permissions: + contents: write + packages: write diff --git a/AGENTS.md b/AGENTS.md index 7c9e008..e8536a5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -96,3 +96,7 @@ Before merging any pull request: 1. **Read all comments** on the PR — conversation comments, review comments (including those on specific lines), and bot comments. Address or acknowledge them. Do not merge while review feedback is unresolved. 2. **Wait for CI to complete successfully.** GitHub Actions (and other required checks) on the PR must finish and pass. Do not merge while checks are pending, failed, cancelled, or skipped when they are required. If CI fails, fix the cause and wait for a green run before merging. + +## Dependency release policy + +Images and CI install hash-pinned `requirements*.lock`; direct constraints remain in `requirements*.txt`. Regenerate with `python scripts/dependency_release.py update` using pinned uv (and pnpm for the podcast frontend). Preserve the three-day release age, bounded upgrades, production-graph release decision, and exact-commit validation in the nightly workflows. Developer-only updates must not publish a release. Container checks use native ARM64 and AMD64 runners with no credentials or external-service access. diff --git a/Dockerfile b/Dockerfile index 9e983eb..039e46e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,11 +4,13 @@ FROM python:3.15.0-alpine3.24 AS build WORKDIR /src +COPY --from=ghcr.io/astral-sh/uv:0.13.7 /uv /usr/local/bin/uv + RUN python -m venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" -RUN --mount=type=bind,source=requirements.txt,target=requirements.txt \ - pip install --no-cache-dir --no-compile -r requirements.txt +RUN --mount=type=bind,source=requirements.lock,target=requirements.lock \ + uv pip install --python /opt/venv/bin/python --require-hashes --exclude-newer 3d -r requirements.lock FROM python:3.15.0-alpine3.24 AS runtime diff --git a/README.md b/README.md index 1ee0ae7..36467e2 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,8 @@ Own sites (`rummerlab.com`, `jodierummer.com`, `physioshark.org`) are dropped. ```bash cp .env.example .env -docker compose up -d --build +docker compose pull +docker compose up -d --no-build ``` Default schedule: **07:00 Australia/Brisbane**. Set `RUN_ON_START=1` for a first send on container start. @@ -72,3 +73,26 @@ pip install -r requirements-dev.txt ruff check . --fix && ruff format . pytest ``` + +## Container releases and nightly dependency updates + +Production Compose pulls GHCR images with native ARM64 (Odroid) and AMD64 support. After merging this change and publishing the first release, run from the existing deployment directory: + +```bash +git pull --ff-only +docker compose pull +docker compose up -d --no-build --remove-orphans +docker compose ps +``` + +Keep the same Compose project name and existing volumes/bind mounts. Keep your `.env` and credentials; do not delete production data. The existing Watchtower installation can follow `latest` using the containers' `com.centurylinklabs.watchtower.enable=true` labels. If Watchtower filters names or scopes, include these containers in that configuration. No second Watchtower instance is needed. Watchtower applies new images, while future Compose and environment changes still need `git pull` and `docker compose up`. GHCR packages must be public for anonymous pulls; alternatively configure registry authentication in Docker and Watchtower. + +Use the Compose tag variable (`SCHOLAR_IMAGE_TAG` for Scholar, `IMAGE_TAG` for the other apps) to pin both services to a published `vMAJOR.MINOR.PATCH` tag for rollback. Local builds use `docker compose -f docker-compose.yml -f docker-compose.build.yml up -d --build` (Scholar must first build its base service with the same two files). + +`docker-release.yml` publishes stable `v*` tag pushes, manual runs with an existing version tag, and calls from the nightly updater. It checks the exact release commit, validates both native architectures without secrets or upstream services, publishes the GitHub release, then updates the multi-platform `latest` tags. To publish manually, push an unused stable version tag on `main`, or rerun the Docker release workflow with that existing tag. The normal `GITHUB_TOKEN` needs contents/packages write permission; no PAT is required. Tag publication created by `GITHUB_TOKEN` does not trigger other workflows, so nightly calls the reusable release workflow explicitly. + +Nightly updates run at 00:37 Australia/Brisbane. Python direct constraints live in `requirements.txt` and `requirements-dev.txt`; their generated `requirements.lock` and `requirements-dev.lock` pin the full graph with hashes. uv excludes versions uploaded in the last **three days** and keeps upgrades within each locked package's major (within its minor for 0.x), without downgrading. The podcast frontend uses pinned pnpm, a frozen lockfile in CI/Docker, and `minimumReleaseAge: 4320` for direct and transitive packages. The age gate reduces exposure to newly compromised releases; it does not guarantee package safety. + +Only a changed **production** Python graph or podcast frontend production graph creates a patch version, tag, GitHub release, and image. This includes transitive and platform-specific runtime changes. Developer tooling, frontend devDependencies, and hash-only lock changes are committed after checks but do not release. With no changes, the run does nothing. Tests, lint, and a local production image smoke test run before a production update is committed; the release then checks both architectures. The bot refuses to rebase if `main` changed during validation, and pushes the tested commit/tag atomically. Branch rules must allow this bot to push dependency commits to `main`; failures remain visible in Actions rather than bypassing protections. + +To refresh manually, install `uv==0.13.7` (and `pnpm@12.15.0` for the podcast frontend), then run `python scripts/dependency_release.py update`. Do not edit generated lockfiles by hand. Nightly uses existing stable tags when choosing the next patch version, even if project metadata previously lagged behind a release. diff --git a/docker-compose.build.yml b/docker-compose.build.yml new file mode 100644 index 0000000..cf12e68 --- /dev/null +++ b/docker-compose.build.yml @@ -0,0 +1,7 @@ +# Local builds; deployment uses docker-compose.yml alone. +services: + digest: + build: . + image: media-alerts:local + labels: + com.centurylinklabs.watchtower.enable: 'false' diff --git a/docker-compose.yml b/docker-compose.yml index 115d94b..c5b33b8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,8 @@ services: digest: - build: . + image: ghcr.io/rummerlab/media-alerts:${IMAGE_TAG:-latest} + labels: + com.centurylinklabs.watchtower.enable: "true" container_name: rummerlab-media-alerts # Must own ./data on the host, or seen.json can't be saved and items repeat. user: "${APP_UID:-1000}:${APP_GID:-1000}" diff --git a/requirements-dev.lock b/requirements-dev.lock new file mode 100644 index 0000000..c044367 --- /dev/null +++ b/requirements-dev.lock @@ -0,0 +1,231 @@ +certifi==2026.10.23 \ + --hash=sha256:a9895e6e2758b371e0545e321a3a8fd1fcfd9829ada8824a936dfb16aaaf36cd \ + --hash=sha256:e9b54de76e530bb6cf0ccd036787103acb58fd42ba930ea8bf948ddbaa2f61d1 +charset-normalizer==3.5.2 \ + --hash=sha256:01077390b03f7988f11d700a2194e69b119741a86b1a638b1db88891e3eced8e \ + --hash=sha256:01b0c0d2262a9e28e8484a278c7e1b5d650e3ac8cf2683d2967e25899f208bdf \ + --hash=sha256:04851f73ae72b8413dddadb16a49dfee95263553741fd42d546f7d66907e6be5 \ + --hash=sha256:0521c5665880b33d603717defa76c094048900010897909952397feb3039da56 \ + --hash=sha256:0774bf9bf620249fee3e0b8b9fd3065de213be30f3aa94ce2494b3b638949e26 \ + --hash=sha256:0891b9d3903c5571c03771ca669a4b0ec5618ca722a5c957d3d29cd4e5062848 \ + --hash=sha256:0c951d5e6dd9c2ff60609476752bee49da4206adde960ebc247766937f72e718 \ + --hash=sha256:0fed1d06615f022ee3b13caf5e8b180cfea32bb2c5aded8a9d44277afc040f93 \ + --hash=sha256:114e4d0c92d618409ed82a99e22b5c5e768fe995f2973f78265f4524f49d4640 \ + --hash=sha256:11912e4bb14baae7c5d8791aa55ba0a3a03ec6729073307b0f57270abaa713d3 \ + --hash=sha256:11a4d68a6ecda3292cb1e50239e111543ba5d709bb62a6b4ea1afcfa729d8875 \ + --hash=sha256:124fbf1a8ff966d87ae05bb8bd45a71f966055ed8bba320d0c7cf450bc5f4d0e \ + --hash=sha256:1461ac396c4fdb983a675f20aa555624f0ee18ac83d832b9244ffff3d8055275 \ + --hash=sha256:1503bccbeb36d5527790c3930327704c39af22de3112f1b1666a9f3ce15ee204 \ + --hash=sha256:15bb4005af6320d259dc7593ca84a38d7fe06a421dbcf7b910ae23979101e787 \ + --hash=sha256:15c44f7edfd477b06f517a5cc317fc1707edb9de2c865f43d4b6513907473234 \ + --hash=sha256:16fa0eccf81304b79c5cd87f9271c3b85dd9dd99245e4422ae9c0dd45e0f99d3 \ + --hash=sha256:183b88127acdb4fabe59d951ab424faf1af7b63cdbb5f776186c1ea2ffcaed98 \ + --hash=sha256:195c26fb65950f8fce54e26349852b7bdd7c5f120aeefbcc440b8a20faaed4a3 \ + --hash=sha256:1afb975bd5d68d5ce9f6b6d44fdf2f7e34b895a35e95708a7a91b20a3b51d187 \ + --hash=sha256:1b4cbc7c3491ccb4aa17fcd8165649d01cf39f76de1696da8631b5f71b85401d \ + --hash=sha256:1bc0baf5ef96b6ede57d47f4b8fe4d9d84019c3bfcbeb20a41edc6a6ee341f1f \ + --hash=sha256:1c50fe28bbc2ced33386f298650d91218076c05420e6cbd790b913adc41659e7 \ + --hash=sha256:1db38f4c5496827c1a501846d64d14c3b80c7e6714e406cd7dc36a9899fa1011 \ + --hash=sha256:211d5a3eb6af8f513b8d4ca19a8c1b7accab1b5f0d3175f9826b03c1a920dc1f \ + --hash=sha256:23851fb4e1b85ed3f6c2a27b777cdfe2e19fb5b38429a8faf38c7542b7665869 \ + --hash=sha256:254eb48b9fa5ee9898a3c445825a1f340fe53712a098904b39b0bddba8ea3cb1 \ + --hash=sha256:2625388c6c754520c37abaf3b41eb34d1cc4a373f457898f08606c8e362b891d \ + --hash=sha256:281cb91036248400f4cc957495cccd44c275c2e0c5854f7e45ac5cf7dc193847 \ + --hash=sha256:28a15fdad492a99b6eccfaaed66ef3f74050680545ea61ec8b2f4c538f1f1320 \ + --hash=sha256:28b4f0d66fb834ff90f28209ac7bce77868c45d8c93e26f906709d9b7c2e1af9 \ + --hash=sha256:2a925889534b3748302dae5dead07cc13480de1dac3aea80a941b729b471ef93 \ + --hash=sha256:2b7b3bbfb4fe8ef40600792d762fbaa9057559f9d3fad209525b7a22b99e91fd \ + --hash=sha256:2c9ad19a6cfcd5ea5c0d41161d22f9df1dcc277e9bef2751391334546a314c00 \ + --hash=sha256:2cc961b171b3f3440f410489ab3573e86aea8736134ebbb40ea1338b7f0831bc \ + --hash=sha256:2ce45c6627b22c47e390bc91a41c3d13032192e699fa0bea96e9671b373d69b0 \ + --hash=sha256:2e06a3a98f916dd41d27f3105e02e7a40181c98c94b9158733d03a6f80506c09 \ + --hash=sha256:304d5463e65a35d7bb0850550e0780395395f6fcf452f04db7d5ca7cecc425ac \ + --hash=sha256:304d8e4d493af723536393eee0c689eb7813f4a474c8b479dee63f1fdd98f621 \ + --hash=sha256:30fcd120b732aa79317f08dee04d7de0847822e4cf7ee0e9f445bb958832252c \ + --hash=sha256:31f3930700408d211f13378ccbe1c40845d8da54bd0681fac3a9b5aae81c7aa8 \ + --hash=sha256:34276fd796040bf0993ab33a369aa572e6979c7aab225a88893667ad8eac8f7a \ + --hash=sha256:355ad8011081dec5412240c087a9a0c9d4d5039f3ed11a3f13e18c2b29b56c51 \ + --hash=sha256:38a873987f3be698494da8b2e3085e29da02da7b633dce73e79c699a113d7bf0 \ + --hash=sha256:39de2a259fc954455c57274dc94c79d5842774e1247a016aff30bc0efed0f4ef \ + --hash=sha256:3d14b50de6bf4d0edf857a9386836846f982b8f524e188e2e68b96d702bcf4aa \ + --hash=sha256:3d21b8b13c7592db2ac5e544a6d83187b995257472b0c9e8351b6d507ae37ed6 \ + --hash=sha256:3d31298449090ab8d47b7b1b2a555ff73cac7ed438a08b7ac160980c7ebed649 \ + --hash=sha256:3ddacd27458c45bdacd6bd6db644bfb730efbf9e830310186e3045c9c5be8fb2 \ + --hash=sha256:3df041de8887954562c9b261cba85ca0e9ded74048daf125f45edcfaa4832229 \ + --hash=sha256:40ab6bffa02ae10a0581e6c198be7d2d8ca5c2a0c64e4ed3465d766df457573e \ + --hash=sha256:4275811936e2f06feff5e598fb42a1b7ae852da8e39605211892b56b81a34efd \ + --hash=sha256:443eae2bf318abeaf6f15d785138f71fd6de770e99a92158b8b814265e079115 \ + --hash=sha256:447441e76ec720b15e64418d32e092297340387053047c7c694f579efb0ee1d9 \ + --hash=sha256:4495c5002a7b28557e7e222e77e0b661183e432b7d6d2e788101e3f240e05b8c \ + --hash=sha256:44bd4fbb29dfbeba60e7d2bd000c59e4b21ddb3cc53912b14048d37092706d7c \ + --hash=sha256:4685902cf26edf013ed7a3da0f426ebba7a00ebb9541386d835afbf002c11cab \ + --hash=sha256:498dc3188ca05a68231ac3fdbfc7f57eb67e1343c30e0fea17f8218c1599b253 \ + --hash=sha256:4c2b5031f63e331e3839b40aed2dd6f191e9c07edbde303e7876846ea1946995 \ + --hash=sha256:4d48f2d08b9de5864e2c8744d4461b862fb149a18274abc8b698c45975573438 \ + --hash=sha256:4f87960d57feabfb618e4e0af6e7371645fa26a277860739d6e5d6e0012c92f0 \ + --hash=sha256:50e3adfb96fc189eb27b1cf62d3b598b89b4bb0420d93a3d3e42e137409011be \ + --hash=sha256:51cf45226a9b588d0d2b4880c62d686934b63ab0bd79ca23ab0e9762eb27441b \ + --hash=sha256:52aa6992700996af31f375de0c6bacd402b0097fe40b53c426b9f51a90ebabc7 \ + --hash=sha256:55ea99acb17b9325618de155a0cd6a2e8f5d10be008113e1d433bbb58db543b2 \ + --hash=sha256:56bc200a365efb37383b7852e4cc5898d3b2da5987289b543956cf8cad71018a \ + --hash=sha256:588461c2e8384d309bd63e5826019b6977bc66d629b99ac8737bb795d7b2cb5a \ + --hash=sha256:58ca3755ee7ff7f59b57789ec9833c9de9ea275405cdd240eda1f193112e398a \ + --hash=sha256:58f361dcbab699cf8f42db3f47c8e7fd1036f138c23a5d08de9fde5f425a730c \ + --hash=sha256:598a11a2c7ebaa5334bf698bf29568c9c390abac6a154d8170fedecd1cea38c5 \ + --hash=sha256:59f63901b0031c3136cf64704dcb21de0bbae62ce2c9529bc39d27665463de37 \ + --hash=sha256:5cde776b7cc66e4f6c99612cea4aa7269aa65863f7a15841b2c264f103822f4e \ + --hash=sha256:5e2b6b57e9733d39f0c9fd3185efa6b8e29652c4cd8fe94180272cf6ed9a78c4 \ + --hash=sha256:5fb29fb8cd1a46c27a1bf9613ad5ec2599310d46b4025d9556404a6b6a292800 \ + --hash=sha256:6045373d5a89a5ec71afde535db987ca28e76dfa276c2d4c818265b375d4b055 \ + --hash=sha256:619799369eeef6366ed3e8755a5670f4f2f0fb6b30a0fd7264dc0fdc2357058e \ + --hash=sha256:62588a277bfb59def052abd940703fa35107152bf479781a878617d60faf8fb5 \ + --hash=sha256:62603db9a7caa0802eaa28c1c46fecd7b3a263a774069c24c3c28c302448721c \ + --hash=sha256:65cd72beeeca9d3aaea1201e5923859f308f952f9c71de93f06063c79f0f7a3b \ + --hash=sha256:68eb192d85ab8e5f6ec69c2bc6ac0179fbf04a5ac1569d12fbef74883fe102d0 \ + --hash=sha256:6bd128f206a7752ae1f2ab6c61bf8a24ba28913a10df8b14c2637b973ff97a80 \ + --hash=sha256:6be488a102b8cf28d0391d8c4ba7748938ae28b78ad901f8585520fca33ead1a \ + --hash=sha256:7218e8f32b0956cfcd048fd42d9d5779809745ca1d86113ca56f66e7ae1549c4 \ + --hash=sha256:7441d755b7ab94f8d4eb3e43ec05482d760842fd263d003a99102d742cd835e2 \ + --hash=sha256:749e97e1b32313717a565abbe321bc2190bc8b35f1a67e4cdbc7c56c8d8ffe58 \ + --hash=sha256:75a3ceed0724d625d64b86ca20aba182e4df462e04c2414fc941c0f523f06aac \ + --hash=sha256:780fbe7cab297b81dad9fb8dc5eb003c0468ffb0d9e5f65068c53a34661a96bc \ + --hash=sha256:78456a747de8dc58360ffa581f30a002baf5aa28cb262536545e91f113ed7639 \ + --hash=sha256:7967d08cf06dee78443b874f98c98036f624f3a4e73e11f9f64f5be4d25393cf \ + --hash=sha256:7a881931aa470808df94a8c380eed2bbbc76cd9dc622310f99665658c821eb6d \ + --hash=sha256:7dcd882da75ef9adf94903b1e3b9419e8aa8fb4c7396822b834b9ef7fb96954f \ + --hash=sha256:7e841fb9010836c992c9f12fcbd43a831de93a5f726fc1ccd8ca1d0268c5014c \ + --hash=sha256:7fdde2c9fd9e3eca40631e024664cf2584272cc8f96308cbe5fdfc930f51d8bc \ + --hash=sha256:8024d00c3faf3fc0c16e07a69f4405e8eac7cc0ab15f65fe6cf43827c4cf72b4 \ + --hash=sha256:80d02b6f04e92601a081dd97b23d3128033098bff5d35d392ddcc0476ea11253 \ + --hash=sha256:838dcc90063569a0448120554591a1d6c4a4ffe11babf048908793154ab86ade \ + --hash=sha256:849df64e889b2e17230d58410a03dba311a65b163508fd33679b2b737d4b7858 \ + --hash=sha256:87475fabc8d9996fd9c27debb395e642e8c838d78a00b6e932227a0e06b81e26 \ + --hash=sha256:87e50a3e7cb90af586b6c5faf23e302a970415ac73bd7bd90a515a04b427ef96 \ + --hash=sha256:89b53f3cda69831909888e0494f4fa0bcd3537e3e138dabeb620bd6ad946bae8 \ + --hash=sha256:8a893cc101149f80a653f82062ebc95b34525a2614382e1da5458fe7c6997249 \ + --hash=sha256:8b2bfab86aa71ae13aa41a6a26aab338e0db2b8bc75434b05aea89e011ff35a4 \ + --hash=sha256:8d86d6fc60743dc916eb79e2eb1ec4818e21e427731543af40a3021851174a13 \ + --hash=sha256:915563965d418f986e7e145accc592eae9e1a1be3566ff98a05d7a9ec42a76e1 \ + --hash=sha256:92888bb3187c5ba50500b00b3b310c9f2c651709d28036077680cb5255450a03 \ + --hash=sha256:93223adc95033dd47133a46ccfc316a0139176fd79085762e27202ec56018f03 \ + --hash=sha256:9373ad13ef0d2c0fb761e04e55bfdee5a08b52cef2c882c8fbe9935b1517152e \ + --hash=sha256:9409a8bf35cf78353942504b24a57de3d75b708997a1e4bd8db71ac8633ce364 \ + --hash=sha256:9b7f416ff0978e2f2249330527f0ad6fa02f4932e6199692d3b52da2048c19e4 \ + --hash=sha256:9bde855991b7e362c146535e3136a50bfaffc0487d38b33ca7e5edefc6e23849 \ + --hash=sha256:9cae88599c7219005d879f98e5ed53341e9a122af585e1091200358a3003d2a0 \ + --hash=sha256:9cf9b1a857e25c4baceeb3624e92a56df3668f398c4acba74e174d81fb4d1d3a \ + --hash=sha256:9f56f72050826f63dcee7a7f55b0a77168cb3bfc553fd405e7f8f9ece75a4036 \ + --hash=sha256:a090bb2c68df85450502e3e20d665e3a5af9c65a84d6508ed477badd49166fd3 \ + --hash=sha256:a192e2c40070d92c3ccf777e3a5c4ff515573cd2bb7ed0c537fdadbbec5bbf21 \ + --hash=sha256:a19a731138fc27d5682277d3b9df22855cea1239bce7fcec5f78f42ef2d1f3c3 \ + --hash=sha256:a66c3bc5ab1f0ff2164fc9965ddd611ff0802173f4b9d24554c563f6ab7e1d6e \ + --hash=sha256:a815775b6c38d4e0ff7bcffbeba67feded90202bb6a226b8dd35f1c855217413 \ + --hash=sha256:a89012d6d5476ee112d20d998570ed58df2260a852afb1758809cd6900411d21 \ + --hash=sha256:ae4f5fea5b8b8ccff88238cc8569303e5ee95efae67fa62922a311397a71f346 \ + --hash=sha256:b6856554c4f44d79fc2307d5768854310a8f0096e501c75637542c82292b0429 \ + --hash=sha256:b6b751274acb69d77b3323d6b7dbaa3c7fdfc1eb829b7eb61d262f32e1af9685 \ + --hash=sha256:b736353c0a625bbd5fcec108576e2385db3496f4f771f785ff32e108d3c3bc45 \ + --hash=sha256:b7fd005a73d9e657273b7a10dc71a9e03c8fb9ee6999798d6918ce095b81ac7f \ + --hash=sha256:b91363207bd9dc966a691e959bb47f64b30f7ac4b072be9968b366982f7db77c \ + --hash=sha256:ba0b1d2620edf869789c3879223f52bf2afc5d31b3cb47cc57b3a12c05e2aa9d \ + --hash=sha256:bbbfc8e28816f19d7c0f1816664980c0a9875d01b27cdf8eedddb639d9e108ad \ + --hash=sha256:bd16aabe4a02a297c23417aa17ac6299dbd8c49f673bcd645b4929b11f5a4400 \ + --hash=sha256:c0afc6800ba57ccc350374c5bd6150419915d95ce93cdbab2d783d75eaf30ecb \ + --hash=sha256:c6708715abcf3c73b99508253e961a9967f02fe536532834149574eda6de0d1c \ + --hash=sha256:c7c9ab723cde841fefb34efbad91e87f00a674b1fe1cd0784fde742bf2c154dc \ + --hash=sha256:c8f3d67aeaf55f017982b73683f0e7342ba2f6635a78f69ce89ebb26aa411e5c \ + --hash=sha256:c9790464842f85f437dbbb54417eda1e0e6bfc52dd8d22d6fd1c994b73b2dc74 \ + --hash=sha256:ca403d7e4798f525fdfc78e258820419cbbd0f0ecbab9de7840e3c017cf6b8cf \ + --hash=sha256:d008d90a7f2471519aef0c90dfbe73b3e6e4d5e66ac48e19154c17e89e98b604 \ + --hash=sha256:d19fbd981a488e22cd04883659ca6b08f50b5974f9fd7c95655ef6a043e5893f \ + --hash=sha256:d1befeed746d247c81127bb14de9dc3d30edb6e5976d34f83f86ed262b1d9105 \ + --hash=sha256:d2374b62878abb00cd8309b32af6c0b715cd02dec0ca74ef12e5069bdc64144a \ + --hash=sha256:d376bbd28b3a8999db1a103b3b388aee6f1ddeb3e51bc2172993efdcd86e064d \ + --hash=sha256:d4a7319f304a774bed22115bc891618e45f85065ab44ea6acd07d274e750519a \ + --hash=sha256:d6734d2ef8a50fbf8445c139477da401f50d62a0606bf00e20ec6d87773fefb1 \ + --hash=sha256:d760fe2a4d7c3b226cb9026d6a842868d52a7901bd98420e1baf14e80da85cf5 \ + --hash=sha256:d913de495d90407cd859d263bee2e5d1a4ed3eb6573c04e70d9ec619a7cbed7f \ + --hash=sha256:db19d07e2e0129e974a0e65d0064fc222a446cd5122c2fd4184d2af9fc734a9e \ + --hash=sha256:dca9ab98072a5a54ebacebdc45f53e645336b320c667410b061be1ca588ae709 \ + --hash=sha256:ddc7dacc8ece3a182e7f15cb862d1fd616b46d076cb1ae9dd232b2c38b655874 \ + --hash=sha256:ddf19c062bea7a0cc80f519243d2c01dd091be0cf952a0750d4ad576709559f5 \ + --hash=sha256:def79fa35ef0cef8d2accec024f4fdc7ead3012ff02f5215c783f39f03ef8cfc \ + --hash=sha256:df29a0a7107f7011e77f4eebdddec4c7331e24d787a0b21a46d63bdf7445da95 \ + --hash=sha256:e09a3942ecbdee5cce73ea9d42da82b81b72ac1bf031ce069b93b5adf4eac8cd \ + --hash=sha256:e242bb1c5e76e97dfa9e7f209a71e93a01d7f19ffdd5cfbb2e2d55b4f08f8ab0 \ + --hash=sha256:e243bd13217235fc7290c621941c3f5cc8b66e4872495be821d7436ba2fb838d \ + --hash=sha256:e2af3aad578aa6bd1384bcf4750fc285e5a9de53f40b7d41e5a0bf748edeb2b3 \ + --hash=sha256:e4e81e09c1578b8df602e3db08b0b3ea0a6947ad612f52bf8dc5ea8d47691f0c \ + --hash=sha256:e54da4baf05720032d527874d40b65fa4d7e5c6c6a43d0c3adbeffcaf275a2b3 \ + --hash=sha256:e80e6c2f55656b4824d72065abb4ddd6a525c74bd78a0aab5d9fc2cf4fb5af50 \ + --hash=sha256:ed2a239c0ea213acc1908150a3037257083c7c083128f1a4cec2ec4b97dca491 \ + --hash=sha256:ed905975ab14056a2e5eb1c376cb2e1ebc5396baf84163939c518556fccde9f5 \ + --hash=sha256:ee21e28f0430bd6dc9086c6e525d5e818a44a5ad19720c8a0ef766792f3eb5e5 \ + --hash=sha256:ee43c17b173d46a3212baa6ead3ae258eeabdae48c263a01ccf0218c366dd655 \ + --hash=sha256:ef4fcbf3327382cd4c9f540babd61248208af7b93eec4de397b4d5f58a09e288 \ + --hash=sha256:eff0ac9dbe711a4aee69bf04a83896aa9b85f19641264053a9f6d48573abb7dd \ + --hash=sha256:f0aa869112ef88429ae17820d99c3dd9504c9e9c671d3c246f3d7442cb051084 \ + --hash=sha256:f3c96f633825733f735c5a9cf21d21a257d8e1edf0b1cee0a064b9c424ca0f7d \ + --hash=sha256:f5833ad231be5eb6553de524a70f48d71b2c8563101750531e0b80184e175cd4 \ + --hash=sha256:f5ec61164adcec446f8969a3358ec3f9b26bbda3b9213e5586d219afa8df2915 \ + --hash=sha256:f7d486c83842422badd511868fd8a9a20e9407ace71564b6af47ce7e60a336c1 \ + --hash=sha256:fb9e68df06293761f9fe66ade60a9bc6d0f5e42b8acf2939a9158af86ab0e5bd \ + --hash=sha256:fc14a032f813bf5fe624d991960ea83e9715adc27e4c1830a2361eb1d02ac341 \ + --hash=sha256:fcff63213e8e6e47770541a4607175404f47cbb3ebea7b6058cc82d524a0e424 \ + --hash=sha256:fd1fbe0f116b6e55da77aca2c6ddcddcfac2186cbf78bdebf40fc156efca389d \ + --hash=sha256:fe9753dfee015c570d73df76f899f18444d41388bffcde097deba51c4fadbb9f +colorama==0.4.6 ; sys_platform == 'win32' \ + --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ + --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 +feedparser==6.0.14 \ + --hash=sha256:088679b0c4b543ee211a820dd544698c76a402122eae7473c04a43425f283d06 \ + --hash=sha256:e35e3f760151b0c3b22cac9684155cae186a233e16c49bcbc6c49e91e3131137 +feedparser-sgmllib==2.1.0 \ + --hash=sha256:2cab2d43b95a954f920f18aebce7a4dbbb3f539780b127e2aa114f579821e01d \ + --hash=sha256:61facf2918c4389b5b00714f76c5e03431ffcd94cd1f51d657edd6cd7c396579 +idna==3.20 \ + --hash=sha256:a7db850025b95ded1eae8a46181a1a6c56c92c96f0e2b005d9ff8dc0210cab44 \ + --hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c +iniconfig==2.3.1 \ + --hash=sha256:67f4b9c50da0dedf52af349e7749a80a9057a5031199791b906c3bb3ae878960 \ + --hash=sha256:9121e2c1fdb355232495be3194c8dfe87ccc2d5dee45947b78e68f499790d7a7 +packaging==26.3 \ + --hash=sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79 \ + --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c +pluggy==1.7.0 \ + --hash=sha256:7dd7b0d8832ba3cb632c306926ded123429211b83641b35dc5c41ad2d34f9bec \ + --hash=sha256:d1eaa46ebb595891b860ab086b4d09c8588af65ebd4361b8e8f4bb8920b90ba8 +pygments==2.21.0 \ + --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 \ + --hash=sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c +pytest==9.2.0 \ + --hash=sha256:07acdcf88ec174f907dc01af70bf52d49b014bbab03faeeade31c96b18c2e588 \ + --hash=sha256:97c4f3b1f3c7414aa36465e09b8220f1d03627993bd51b1282e193753c80557b +python-dotenv==1.2.4 \ + --hash=sha256:42269a8a5b3fd54ffa6f3d84b18abed50064717576b4ecf03dc4a55d8aa04fdc \ + --hash=sha256:f0d53e69935a851c0dcc78f3ab7aaccd8cabef0b92382b576b824212902873c0 +requests==2.34.2 \ + --hash=sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0 \ + --hash=sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed +ruff==0.17.3 \ + --hash=sha256:029c37cbd3de48ca37aa12117bead2d065f15da17d66bf84e0d4274013705db2 \ + --hash=sha256:27bb571ac78fef178fe5118d2827df95c2aae74a48fff2b15f6acd03af5ff5bb \ + --hash=sha256:39405f341deec934b4289634324ad695f72df2970f9121582872eaf5b722f0f5 \ + --hash=sha256:4590b9d86c0b1543ebb09094254e191cd43fe8edaf330baa035aab03da251532 \ + --hash=sha256:46539cb031b01fd29ae0a02142483c46640b233ee12bb1c1b690bffa1555d5ca \ + --hash=sha256:56b8ffb3f3b3cbccb8b76b71b38261b7ed982ef5d20f5b447b1b61a7f4949b24 \ + --hash=sha256:68074094f55ca3d29ab19491f640282f7a84061c4c7977aa5094b968ca457e9a \ + --hash=sha256:692fdb46d0fd9c71e380947dc5fc72f2c3f881073bc1f739e4579376231affbe \ + --hash=sha256:6a754c0341bc9ca151b7b335988b3263921c08859f84ca219b70cee825571b6f \ + --hash=sha256:7fa4b0f931cdbcb8a52044f370a3eb429fb42eb88807b0e800fcaa98dd42b24e \ + --hash=sha256:81fce74bcd6be0e9da7c67c7553fd0f1f12964a2052cd728ef917b937a5ca1d9 \ + --hash=sha256:a57049c8addb3662073859bb55a7ad35aa54f8a7c9ed268911d1333c5aadaaa9 \ + --hash=sha256:ab5fa7ed5ce18554ea69d850ad162cbaa0c85fc47c08d83a569f806681c9a6ad \ + --hash=sha256:ab86b84cd9d05e56d329742c0cabdcbe2d1d56c98f4a04aab9b5b66196febfb4 \ + --hash=sha256:b75cc113b3aca388933d8296b667b1ac401a80317ea3074c9b0a66541199da29 \ + --hash=sha256:bbde18beccd98c29a227c63c99022e3443b99258e08326df6425dfe0443705ef \ + --hash=sha256:c673c170e27834d1262e3a9c1e97bdc9b9c3b180c63d89173ce69747232474c1 \ + --hash=sha256:e407b4a6852853a9a2cdce96963e94ad9775578bb44e7561a0f2829f3cc04b11 +urllib3==2.8.0 \ + --hash=sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3 \ + --hash=sha256:63bf2ead4c879426ebf22ef2a781eeb4aa3b4ae798a0435506f8687fd5bb9b63 diff --git a/requirements-dev.txt b/requirements-dev.txt index a22d1f2..c8e5e88 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ # Local development / CI: lint + tests (includes runtime deps). -r requirements.txt -ruff>=0.17.3 -pytest>=9.2.0 +ruff>=0.17.3,<0.18 +pytest>=9.2.0,<10 diff --git a/requirements.lock b/requirements.lock new file mode 100644 index 0000000..e463f47 --- /dev/null +++ b/requirements.lock @@ -0,0 +1,194 @@ +certifi==2026.10.23 \ + --hash=sha256:a9895e6e2758b371e0545e321a3a8fd1fcfd9829ada8824a936dfb16aaaf36cd \ + --hash=sha256:e9b54de76e530bb6cf0ccd036787103acb58fd42ba930ea8bf948ddbaa2f61d1 +charset-normalizer==3.5.2 \ + --hash=sha256:01077390b03f7988f11d700a2194e69b119741a86b1a638b1db88891e3eced8e \ + --hash=sha256:01b0c0d2262a9e28e8484a278c7e1b5d650e3ac8cf2683d2967e25899f208bdf \ + --hash=sha256:04851f73ae72b8413dddadb16a49dfee95263553741fd42d546f7d66907e6be5 \ + --hash=sha256:0521c5665880b33d603717defa76c094048900010897909952397feb3039da56 \ + --hash=sha256:0774bf9bf620249fee3e0b8b9fd3065de213be30f3aa94ce2494b3b638949e26 \ + --hash=sha256:0891b9d3903c5571c03771ca669a4b0ec5618ca722a5c957d3d29cd4e5062848 \ + --hash=sha256:0c951d5e6dd9c2ff60609476752bee49da4206adde960ebc247766937f72e718 \ + --hash=sha256:0fed1d06615f022ee3b13caf5e8b180cfea32bb2c5aded8a9d44277afc040f93 \ + --hash=sha256:114e4d0c92d618409ed82a99e22b5c5e768fe995f2973f78265f4524f49d4640 \ + --hash=sha256:11912e4bb14baae7c5d8791aa55ba0a3a03ec6729073307b0f57270abaa713d3 \ + --hash=sha256:11a4d68a6ecda3292cb1e50239e111543ba5d709bb62a6b4ea1afcfa729d8875 \ + --hash=sha256:124fbf1a8ff966d87ae05bb8bd45a71f966055ed8bba320d0c7cf450bc5f4d0e \ + --hash=sha256:1461ac396c4fdb983a675f20aa555624f0ee18ac83d832b9244ffff3d8055275 \ + --hash=sha256:1503bccbeb36d5527790c3930327704c39af22de3112f1b1666a9f3ce15ee204 \ + --hash=sha256:15bb4005af6320d259dc7593ca84a38d7fe06a421dbcf7b910ae23979101e787 \ + --hash=sha256:15c44f7edfd477b06f517a5cc317fc1707edb9de2c865f43d4b6513907473234 \ + --hash=sha256:16fa0eccf81304b79c5cd87f9271c3b85dd9dd99245e4422ae9c0dd45e0f99d3 \ + --hash=sha256:183b88127acdb4fabe59d951ab424faf1af7b63cdbb5f776186c1ea2ffcaed98 \ + --hash=sha256:195c26fb65950f8fce54e26349852b7bdd7c5f120aeefbcc440b8a20faaed4a3 \ + --hash=sha256:1afb975bd5d68d5ce9f6b6d44fdf2f7e34b895a35e95708a7a91b20a3b51d187 \ + --hash=sha256:1b4cbc7c3491ccb4aa17fcd8165649d01cf39f76de1696da8631b5f71b85401d \ + --hash=sha256:1bc0baf5ef96b6ede57d47f4b8fe4d9d84019c3bfcbeb20a41edc6a6ee341f1f \ + --hash=sha256:1c50fe28bbc2ced33386f298650d91218076c05420e6cbd790b913adc41659e7 \ + --hash=sha256:1db38f4c5496827c1a501846d64d14c3b80c7e6714e406cd7dc36a9899fa1011 \ + --hash=sha256:211d5a3eb6af8f513b8d4ca19a8c1b7accab1b5f0d3175f9826b03c1a920dc1f \ + --hash=sha256:23851fb4e1b85ed3f6c2a27b777cdfe2e19fb5b38429a8faf38c7542b7665869 \ + --hash=sha256:254eb48b9fa5ee9898a3c445825a1f340fe53712a098904b39b0bddba8ea3cb1 \ + --hash=sha256:2625388c6c754520c37abaf3b41eb34d1cc4a373f457898f08606c8e362b891d \ + --hash=sha256:281cb91036248400f4cc957495cccd44c275c2e0c5854f7e45ac5cf7dc193847 \ + --hash=sha256:28a15fdad492a99b6eccfaaed66ef3f74050680545ea61ec8b2f4c538f1f1320 \ + --hash=sha256:28b4f0d66fb834ff90f28209ac7bce77868c45d8c93e26f906709d9b7c2e1af9 \ + --hash=sha256:2a925889534b3748302dae5dead07cc13480de1dac3aea80a941b729b471ef93 \ + --hash=sha256:2b7b3bbfb4fe8ef40600792d762fbaa9057559f9d3fad209525b7a22b99e91fd \ + --hash=sha256:2c9ad19a6cfcd5ea5c0d41161d22f9df1dcc277e9bef2751391334546a314c00 \ + --hash=sha256:2cc961b171b3f3440f410489ab3573e86aea8736134ebbb40ea1338b7f0831bc \ + --hash=sha256:2ce45c6627b22c47e390bc91a41c3d13032192e699fa0bea96e9671b373d69b0 \ + --hash=sha256:2e06a3a98f916dd41d27f3105e02e7a40181c98c94b9158733d03a6f80506c09 \ + --hash=sha256:304d5463e65a35d7bb0850550e0780395395f6fcf452f04db7d5ca7cecc425ac \ + --hash=sha256:304d8e4d493af723536393eee0c689eb7813f4a474c8b479dee63f1fdd98f621 \ + --hash=sha256:30fcd120b732aa79317f08dee04d7de0847822e4cf7ee0e9f445bb958832252c \ + --hash=sha256:31f3930700408d211f13378ccbe1c40845d8da54bd0681fac3a9b5aae81c7aa8 \ + --hash=sha256:34276fd796040bf0993ab33a369aa572e6979c7aab225a88893667ad8eac8f7a \ + --hash=sha256:355ad8011081dec5412240c087a9a0c9d4d5039f3ed11a3f13e18c2b29b56c51 \ + --hash=sha256:38a873987f3be698494da8b2e3085e29da02da7b633dce73e79c699a113d7bf0 \ + --hash=sha256:39de2a259fc954455c57274dc94c79d5842774e1247a016aff30bc0efed0f4ef \ + --hash=sha256:3d14b50de6bf4d0edf857a9386836846f982b8f524e188e2e68b96d702bcf4aa \ + --hash=sha256:3d21b8b13c7592db2ac5e544a6d83187b995257472b0c9e8351b6d507ae37ed6 \ + --hash=sha256:3d31298449090ab8d47b7b1b2a555ff73cac7ed438a08b7ac160980c7ebed649 \ + --hash=sha256:3ddacd27458c45bdacd6bd6db644bfb730efbf9e830310186e3045c9c5be8fb2 \ + --hash=sha256:3df041de8887954562c9b261cba85ca0e9ded74048daf125f45edcfaa4832229 \ + --hash=sha256:40ab6bffa02ae10a0581e6c198be7d2d8ca5c2a0c64e4ed3465d766df457573e \ + --hash=sha256:4275811936e2f06feff5e598fb42a1b7ae852da8e39605211892b56b81a34efd \ + --hash=sha256:443eae2bf318abeaf6f15d785138f71fd6de770e99a92158b8b814265e079115 \ + --hash=sha256:447441e76ec720b15e64418d32e092297340387053047c7c694f579efb0ee1d9 \ + --hash=sha256:4495c5002a7b28557e7e222e77e0b661183e432b7d6d2e788101e3f240e05b8c \ + --hash=sha256:44bd4fbb29dfbeba60e7d2bd000c59e4b21ddb3cc53912b14048d37092706d7c \ + --hash=sha256:4685902cf26edf013ed7a3da0f426ebba7a00ebb9541386d835afbf002c11cab \ + --hash=sha256:498dc3188ca05a68231ac3fdbfc7f57eb67e1343c30e0fea17f8218c1599b253 \ + --hash=sha256:4c2b5031f63e331e3839b40aed2dd6f191e9c07edbde303e7876846ea1946995 \ + --hash=sha256:4d48f2d08b9de5864e2c8744d4461b862fb149a18274abc8b698c45975573438 \ + --hash=sha256:4f87960d57feabfb618e4e0af6e7371645fa26a277860739d6e5d6e0012c92f0 \ + --hash=sha256:50e3adfb96fc189eb27b1cf62d3b598b89b4bb0420d93a3d3e42e137409011be \ + --hash=sha256:51cf45226a9b588d0d2b4880c62d686934b63ab0bd79ca23ab0e9762eb27441b \ + --hash=sha256:52aa6992700996af31f375de0c6bacd402b0097fe40b53c426b9f51a90ebabc7 \ + --hash=sha256:55ea99acb17b9325618de155a0cd6a2e8f5d10be008113e1d433bbb58db543b2 \ + --hash=sha256:56bc200a365efb37383b7852e4cc5898d3b2da5987289b543956cf8cad71018a \ + --hash=sha256:588461c2e8384d309bd63e5826019b6977bc66d629b99ac8737bb795d7b2cb5a \ + --hash=sha256:58ca3755ee7ff7f59b57789ec9833c9de9ea275405cdd240eda1f193112e398a \ + --hash=sha256:58f361dcbab699cf8f42db3f47c8e7fd1036f138c23a5d08de9fde5f425a730c \ + --hash=sha256:598a11a2c7ebaa5334bf698bf29568c9c390abac6a154d8170fedecd1cea38c5 \ + --hash=sha256:59f63901b0031c3136cf64704dcb21de0bbae62ce2c9529bc39d27665463de37 \ + --hash=sha256:5cde776b7cc66e4f6c99612cea4aa7269aa65863f7a15841b2c264f103822f4e \ + --hash=sha256:5e2b6b57e9733d39f0c9fd3185efa6b8e29652c4cd8fe94180272cf6ed9a78c4 \ + --hash=sha256:5fb29fb8cd1a46c27a1bf9613ad5ec2599310d46b4025d9556404a6b6a292800 \ + --hash=sha256:6045373d5a89a5ec71afde535db987ca28e76dfa276c2d4c818265b375d4b055 \ + --hash=sha256:619799369eeef6366ed3e8755a5670f4f2f0fb6b30a0fd7264dc0fdc2357058e \ + --hash=sha256:62588a277bfb59def052abd940703fa35107152bf479781a878617d60faf8fb5 \ + --hash=sha256:62603db9a7caa0802eaa28c1c46fecd7b3a263a774069c24c3c28c302448721c \ + --hash=sha256:65cd72beeeca9d3aaea1201e5923859f308f952f9c71de93f06063c79f0f7a3b \ + --hash=sha256:68eb192d85ab8e5f6ec69c2bc6ac0179fbf04a5ac1569d12fbef74883fe102d0 \ + --hash=sha256:6bd128f206a7752ae1f2ab6c61bf8a24ba28913a10df8b14c2637b973ff97a80 \ + --hash=sha256:6be488a102b8cf28d0391d8c4ba7748938ae28b78ad901f8585520fca33ead1a \ + --hash=sha256:7218e8f32b0956cfcd048fd42d9d5779809745ca1d86113ca56f66e7ae1549c4 \ + --hash=sha256:7441d755b7ab94f8d4eb3e43ec05482d760842fd263d003a99102d742cd835e2 \ + --hash=sha256:749e97e1b32313717a565abbe321bc2190bc8b35f1a67e4cdbc7c56c8d8ffe58 \ + --hash=sha256:75a3ceed0724d625d64b86ca20aba182e4df462e04c2414fc941c0f523f06aac \ + --hash=sha256:780fbe7cab297b81dad9fb8dc5eb003c0468ffb0d9e5f65068c53a34661a96bc \ + --hash=sha256:78456a747de8dc58360ffa581f30a002baf5aa28cb262536545e91f113ed7639 \ + --hash=sha256:7967d08cf06dee78443b874f98c98036f624f3a4e73e11f9f64f5be4d25393cf \ + --hash=sha256:7a881931aa470808df94a8c380eed2bbbc76cd9dc622310f99665658c821eb6d \ + --hash=sha256:7dcd882da75ef9adf94903b1e3b9419e8aa8fb4c7396822b834b9ef7fb96954f \ + --hash=sha256:7e841fb9010836c992c9f12fcbd43a831de93a5f726fc1ccd8ca1d0268c5014c \ + --hash=sha256:7fdde2c9fd9e3eca40631e024664cf2584272cc8f96308cbe5fdfc930f51d8bc \ + --hash=sha256:8024d00c3faf3fc0c16e07a69f4405e8eac7cc0ab15f65fe6cf43827c4cf72b4 \ + --hash=sha256:80d02b6f04e92601a081dd97b23d3128033098bff5d35d392ddcc0476ea11253 \ + --hash=sha256:838dcc90063569a0448120554591a1d6c4a4ffe11babf048908793154ab86ade \ + --hash=sha256:849df64e889b2e17230d58410a03dba311a65b163508fd33679b2b737d4b7858 \ + --hash=sha256:87475fabc8d9996fd9c27debb395e642e8c838d78a00b6e932227a0e06b81e26 \ + --hash=sha256:87e50a3e7cb90af586b6c5faf23e302a970415ac73bd7bd90a515a04b427ef96 \ + --hash=sha256:89b53f3cda69831909888e0494f4fa0bcd3537e3e138dabeb620bd6ad946bae8 \ + --hash=sha256:8a893cc101149f80a653f82062ebc95b34525a2614382e1da5458fe7c6997249 \ + --hash=sha256:8b2bfab86aa71ae13aa41a6a26aab338e0db2b8bc75434b05aea89e011ff35a4 \ + --hash=sha256:8d86d6fc60743dc916eb79e2eb1ec4818e21e427731543af40a3021851174a13 \ + --hash=sha256:915563965d418f986e7e145accc592eae9e1a1be3566ff98a05d7a9ec42a76e1 \ + --hash=sha256:92888bb3187c5ba50500b00b3b310c9f2c651709d28036077680cb5255450a03 \ + --hash=sha256:93223adc95033dd47133a46ccfc316a0139176fd79085762e27202ec56018f03 \ + --hash=sha256:9373ad13ef0d2c0fb761e04e55bfdee5a08b52cef2c882c8fbe9935b1517152e \ + --hash=sha256:9409a8bf35cf78353942504b24a57de3d75b708997a1e4bd8db71ac8633ce364 \ + --hash=sha256:9b7f416ff0978e2f2249330527f0ad6fa02f4932e6199692d3b52da2048c19e4 \ + --hash=sha256:9bde855991b7e362c146535e3136a50bfaffc0487d38b33ca7e5edefc6e23849 \ + --hash=sha256:9cae88599c7219005d879f98e5ed53341e9a122af585e1091200358a3003d2a0 \ + --hash=sha256:9cf9b1a857e25c4baceeb3624e92a56df3668f398c4acba74e174d81fb4d1d3a \ + --hash=sha256:9f56f72050826f63dcee7a7f55b0a77168cb3bfc553fd405e7f8f9ece75a4036 \ + --hash=sha256:a090bb2c68df85450502e3e20d665e3a5af9c65a84d6508ed477badd49166fd3 \ + --hash=sha256:a192e2c40070d92c3ccf777e3a5c4ff515573cd2bb7ed0c537fdadbbec5bbf21 \ + --hash=sha256:a19a731138fc27d5682277d3b9df22855cea1239bce7fcec5f78f42ef2d1f3c3 \ + --hash=sha256:a66c3bc5ab1f0ff2164fc9965ddd611ff0802173f4b9d24554c563f6ab7e1d6e \ + --hash=sha256:a815775b6c38d4e0ff7bcffbeba67feded90202bb6a226b8dd35f1c855217413 \ + --hash=sha256:a89012d6d5476ee112d20d998570ed58df2260a852afb1758809cd6900411d21 \ + --hash=sha256:ae4f5fea5b8b8ccff88238cc8569303e5ee95efae67fa62922a311397a71f346 \ + --hash=sha256:b6856554c4f44d79fc2307d5768854310a8f0096e501c75637542c82292b0429 \ + --hash=sha256:b6b751274acb69d77b3323d6b7dbaa3c7fdfc1eb829b7eb61d262f32e1af9685 \ + --hash=sha256:b736353c0a625bbd5fcec108576e2385db3496f4f771f785ff32e108d3c3bc45 \ + --hash=sha256:b7fd005a73d9e657273b7a10dc71a9e03c8fb9ee6999798d6918ce095b81ac7f \ + --hash=sha256:b91363207bd9dc966a691e959bb47f64b30f7ac4b072be9968b366982f7db77c \ + --hash=sha256:ba0b1d2620edf869789c3879223f52bf2afc5d31b3cb47cc57b3a12c05e2aa9d \ + --hash=sha256:bbbfc8e28816f19d7c0f1816664980c0a9875d01b27cdf8eedddb639d9e108ad \ + --hash=sha256:bd16aabe4a02a297c23417aa17ac6299dbd8c49f673bcd645b4929b11f5a4400 \ + --hash=sha256:c0afc6800ba57ccc350374c5bd6150419915d95ce93cdbab2d783d75eaf30ecb \ + --hash=sha256:c6708715abcf3c73b99508253e961a9967f02fe536532834149574eda6de0d1c \ + --hash=sha256:c7c9ab723cde841fefb34efbad91e87f00a674b1fe1cd0784fde742bf2c154dc \ + --hash=sha256:c8f3d67aeaf55f017982b73683f0e7342ba2f6635a78f69ce89ebb26aa411e5c \ + --hash=sha256:c9790464842f85f437dbbb54417eda1e0e6bfc52dd8d22d6fd1c994b73b2dc74 \ + --hash=sha256:ca403d7e4798f525fdfc78e258820419cbbd0f0ecbab9de7840e3c017cf6b8cf \ + --hash=sha256:d008d90a7f2471519aef0c90dfbe73b3e6e4d5e66ac48e19154c17e89e98b604 \ + --hash=sha256:d19fbd981a488e22cd04883659ca6b08f50b5974f9fd7c95655ef6a043e5893f \ + --hash=sha256:d1befeed746d247c81127bb14de9dc3d30edb6e5976d34f83f86ed262b1d9105 \ + --hash=sha256:d2374b62878abb00cd8309b32af6c0b715cd02dec0ca74ef12e5069bdc64144a \ + --hash=sha256:d376bbd28b3a8999db1a103b3b388aee6f1ddeb3e51bc2172993efdcd86e064d \ + --hash=sha256:d4a7319f304a774bed22115bc891618e45f85065ab44ea6acd07d274e750519a \ + --hash=sha256:d6734d2ef8a50fbf8445c139477da401f50d62a0606bf00e20ec6d87773fefb1 \ + --hash=sha256:d760fe2a4d7c3b226cb9026d6a842868d52a7901bd98420e1baf14e80da85cf5 \ + --hash=sha256:d913de495d90407cd859d263bee2e5d1a4ed3eb6573c04e70d9ec619a7cbed7f \ + --hash=sha256:db19d07e2e0129e974a0e65d0064fc222a446cd5122c2fd4184d2af9fc734a9e \ + --hash=sha256:dca9ab98072a5a54ebacebdc45f53e645336b320c667410b061be1ca588ae709 \ + --hash=sha256:ddc7dacc8ece3a182e7f15cb862d1fd616b46d076cb1ae9dd232b2c38b655874 \ + --hash=sha256:ddf19c062bea7a0cc80f519243d2c01dd091be0cf952a0750d4ad576709559f5 \ + --hash=sha256:def79fa35ef0cef8d2accec024f4fdc7ead3012ff02f5215c783f39f03ef8cfc \ + --hash=sha256:df29a0a7107f7011e77f4eebdddec4c7331e24d787a0b21a46d63bdf7445da95 \ + --hash=sha256:e09a3942ecbdee5cce73ea9d42da82b81b72ac1bf031ce069b93b5adf4eac8cd \ + --hash=sha256:e242bb1c5e76e97dfa9e7f209a71e93a01d7f19ffdd5cfbb2e2d55b4f08f8ab0 \ + --hash=sha256:e243bd13217235fc7290c621941c3f5cc8b66e4872495be821d7436ba2fb838d \ + --hash=sha256:e2af3aad578aa6bd1384bcf4750fc285e5a9de53f40b7d41e5a0bf748edeb2b3 \ + --hash=sha256:e4e81e09c1578b8df602e3db08b0b3ea0a6947ad612f52bf8dc5ea8d47691f0c \ + --hash=sha256:e54da4baf05720032d527874d40b65fa4d7e5c6c6a43d0c3adbeffcaf275a2b3 \ + --hash=sha256:e80e6c2f55656b4824d72065abb4ddd6a525c74bd78a0aab5d9fc2cf4fb5af50 \ + --hash=sha256:ed2a239c0ea213acc1908150a3037257083c7c083128f1a4cec2ec4b97dca491 \ + --hash=sha256:ed905975ab14056a2e5eb1c376cb2e1ebc5396baf84163939c518556fccde9f5 \ + --hash=sha256:ee21e28f0430bd6dc9086c6e525d5e818a44a5ad19720c8a0ef766792f3eb5e5 \ + --hash=sha256:ee43c17b173d46a3212baa6ead3ae258eeabdae48c263a01ccf0218c366dd655 \ + --hash=sha256:ef4fcbf3327382cd4c9f540babd61248208af7b93eec4de397b4d5f58a09e288 \ + --hash=sha256:eff0ac9dbe711a4aee69bf04a83896aa9b85f19641264053a9f6d48573abb7dd \ + --hash=sha256:f0aa869112ef88429ae17820d99c3dd9504c9e9c671d3c246f3d7442cb051084 \ + --hash=sha256:f3c96f633825733f735c5a9cf21d21a257d8e1edf0b1cee0a064b9c424ca0f7d \ + --hash=sha256:f5833ad231be5eb6553de524a70f48d71b2c8563101750531e0b80184e175cd4 \ + --hash=sha256:f5ec61164adcec446f8969a3358ec3f9b26bbda3b9213e5586d219afa8df2915 \ + --hash=sha256:f7d486c83842422badd511868fd8a9a20e9407ace71564b6af47ce7e60a336c1 \ + --hash=sha256:fb9e68df06293761f9fe66ade60a9bc6d0f5e42b8acf2939a9158af86ab0e5bd \ + --hash=sha256:fc14a032f813bf5fe624d991960ea83e9715adc27e4c1830a2361eb1d02ac341 \ + --hash=sha256:fcff63213e8e6e47770541a4607175404f47cbb3ebea7b6058cc82d524a0e424 \ + --hash=sha256:fd1fbe0f116b6e55da77aca2c6ddcddcfac2186cbf78bdebf40fc156efca389d \ + --hash=sha256:fe9753dfee015c570d73df76f899f18444d41388bffcde097deba51c4fadbb9f +feedparser==6.0.14 \ + --hash=sha256:088679b0c4b543ee211a820dd544698c76a402122eae7473c04a43425f283d06 \ + --hash=sha256:e35e3f760151b0c3b22cac9684155cae186a233e16c49bcbc6c49e91e3131137 +feedparser-sgmllib==2.1.0 \ + --hash=sha256:2cab2d43b95a954f920f18aebce7a4dbbb3f539780b127e2aa114f579821e01d \ + --hash=sha256:61facf2918c4389b5b00714f76c5e03431ffcd94cd1f51d657edd6cd7c396579 +idna==3.20 \ + --hash=sha256:a7db850025b95ded1eae8a46181a1a6c56c92c96f0e2b005d9ff8dc0210cab44 \ + --hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c +python-dotenv==1.2.4 \ + --hash=sha256:42269a8a5b3fd54ffa6f3d84b18abed50064717576b4ecf03dc4a55d8aa04fdc \ + --hash=sha256:f0d53e69935a851c0dcc78f3ab7aaccd8cabef0b92382b576b824212902873c0 +requests==2.34.2 \ + --hash=sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0 \ + --hash=sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed +urllib3==2.8.0 \ + --hash=sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3 \ + --hash=sha256:63bf2ead4c879426ebf22ef2a781eeb4aa3b4ae798a0435506f8687fd5bb9b63 diff --git a/requirements.txt b/requirements.txt index ae9d239..8ca159b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -feedparser==6.0.14 -requests==2.34.2 -python-dotenv==1.2.4 +feedparser>=6.0.14,<7 +requests>=2.34.2,<3 +python-dotenv>=1.2.4,<2 diff --git a/scripts/dependency_release.py b/scripts/dependency_release.py new file mode 100644 index 0000000..f32fe66 --- /dev/null +++ b/scripts/dependency_release.py @@ -0,0 +1,206 @@ +"""Resolve aged dependencies and release only when the production graph changes.""" + +import argparse +import json +import os +import re +import shutil +import subprocess +import tempfile +from pathlib import Path + +PIN = re.compile(r"^([\w.-]+)==([^\s;]+)(?:\s*;\s*(.*?))?\s*(?:\\)?$") +VERSION = re.compile(r"v?(\d+)\.(\d+)\.(\d+)$") + + +def lock_graph(content: str) -> frozenset: + """Compare versions and environment markers, ignoring hashes and comments.""" + graph = set() + for line in content.splitlines(): + match = PIN.fullmatch(line.rstrip(" \\")) + if match: + name, version, marker = match.groups() + graph.add((re.sub(r"[-_.]+", "-", name).lower(), version, marker or "")) + return frozenset(graph) + + +def upgrade_constraints(content: str) -> str: + """Keep upgrades in the current major (minor for 0.x), without downgrades.""" + lines = [] + for name, version, marker in sorted(lock_graph(content)): + public = version.split("+")[0] + numbers = public.split(".") + major = int(numbers[0]) + minor = int(numbers[1]) if len(numbers) > 1 else 0 + ceiling = str(major + 1) if major else f"0.{minor + 1}" + suffix = f" ; {marker}" if marker else "" + lines.append(f"{name}>={public},<{ceiling}{suffix}") + return "\n".join(lines) + "\n" + + +def frontend_graph(projects: list) -> frozenset: + """Include production transitives; omit dev and untracked node_modules.""" + graph = set() + + def visit(node): + for group in ("dependencies", "optionalDependencies"): + for name, dependency in node.get(group, {}).items(): + graph.add((name, dependency["version"])) + visit(dependency) + + for project in projects: + visit(project) + return frozenset(graph) + + +def next_version(project_version: str, tags: list[str]) -> str: + """Use existing stable tags as the authority when project metadata lags.""" + versions = [tuple(map(int, VERSION.fullmatch(project_version).groups()))] + versions.extend( + tuple(map(int, match.groups())) for tag in tags if (match := VERSION.fullmatch(tag)) + ) + major, minor, patch = max(versions) + return f"{major}.{minor}.{patch + 1}" + + +def run(*command, cwd=None, capture=False): + """Run a tool and fail the workflow if resolution or validation fails.""" + executable = shutil.which(command[0]) + if executable is None: + raise RuntimeError(f"Required tool is missing: {command[0]}") + return subprocess.run( + [executable, *command[1:]], + cwd=cwd, + check=True, + text=True, + capture_output=capture, + ).stdout + + +def output(**values): + """Expose decisions to Actions, while remaining usable locally.""" + lines = "".join( + f"{key}={str(value).lower() if isinstance(value, bool) else value}\n" + for key, value in values.items() + ) + print(lines, end="") + if path := os.environ.get("GITHUB_OUTPUT"): + with Path(path).open("a", encoding="utf-8") as handle: + handle.write(lines) + + +def update(root: Path) -> None: + """Upgrade bounded Python/npm graphs using the three-day quarantine.""" + policy = json.loads((root / ".github/dependency-policy.json").read_text()) + files = ["requirements.lock", "requirements-dev.lock"] + frontend = root / "webapp/frontend" + if frontend.is_dir(): + files += ["webapp/frontend/package.json", "webapp/frontend/pnpm-lock.yaml"] + before = {name: (root / name).read_text() for name in files} + old_frontend = frozenset() + if frontend.is_dir(): + old_frontend = frontend_graph( + json.loads( + run( + "pnpm", + "list", + "--prod", + "--lockfile-only", + "--depth", + "Infinity", + "--json", + cwd=frontend, + capture=True, + ) + ) + ) + + # A single cutoff applies to all packages selected in this run, including + # build dependencies resolved by uv; production installs consume the locks. + with tempfile.TemporaryDirectory(prefix="dependency-constraints-") as temp: + for name, source in ( + ("requirements.lock", "requirements.txt"), + ("requirements-dev.lock", "requirements-dev.txt"), + ): + constraints = Path(temp) / name + constraints.write_text(upgrade_constraints(before[name])) + command = [ + "uv", + "pip", + "compile", + source, + "--output-file", + name, + "--universal", + "--python-version", + policy["python"], + "--exclude-newer", + "3d", + "--prerelease", + "disallow", + "--generate-hashes", + "--no-header", + "--no-annotate", + "--upgrade", + "--constraint", + str(constraints), + "--quiet", + ] + if name == "requirements-dev.lock": + command += ["--constraint", "requirements.lock"] + if policy.get("torch_backend"): + command += ["--torch-backend", policy["torch_backend"]] + run(*command, cwd=root) + + new_frontend = old_frontend + if frontend.is_dir(): + run("pnpm", "update", "--depth", "Infinity", "--ignore-scripts", cwd=frontend) + new_frontend = frontend_graph( + json.loads( + run( + "pnpm", + "list", + "--prod", + "--lockfile-only", + "--depth", + "Infinity", + "--json", + cwd=frontend, + capture=True, + ) + ) + ) + changed = any((root / name).read_text() != content for name, content in before.items()) + release = ( + lock_graph(before["requirements.lock"]) + != lock_graph((root / "requirements.lock").read_text()) + or new_frontend != old_frontend + ) + output(changed=changed, release=release) + + +def bump(root: Path) -> None: + """Bump project metadata after tests; leave tag creation to the workflow.""" + path = root / "pyproject.toml" + content = path.read_text() + match = re.search(r'^version = "([^"]+)"$', content, re.MULTILINE) + if match is None: + raise ValueError("pyproject.toml has no project version") + tags = run("git", "tag", "--list", "v*", cwd=root, capture=True).splitlines() + version = next_version(match[1], tags) + content = content[: match.start(1)] + version + content[match.end(1) :] + path.write_text(content) + output(version=version) + + +def main() -> None: + """Run from the repository root: update, or bump after validation.""" + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("command", choices=("update", "bump")) + args = parser.parse_args() + root = Path(__file__).resolve().parents[1] + (update if args.command == "update" else bump)(root) + + +if __name__ == "__main__": + main() diff --git a/scripts/smoke_container.py b/scripts/smoke_container.py new file mode 100644 index 0000000..74cbb19 --- /dev/null +++ b/scripts/smoke_container.py @@ -0,0 +1,53 @@ +"""Verify a production container without credentials or upstream services.""" + +import argparse +import json +import subprocess +import time + + +def docker(*args, capture=False): + """Run Docker and surface failures to CI.""" + return subprocess.run( + ["docker", *args], check=True, text=True, capture_output=capture, timeout=180 + ) + + +def main(): + """Check the real default command, non-root user, and readiness.""" + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--image", required=True) + args = parser.parse_args() + container = docker( + "run", "--detach", "--network", "none", "--env", "RUN_ON_START=0", args.image, capture=True + ).stdout.strip() + try: + deadline = time.monotonic() + 120 + while time.monotonic() < deadline: + info = json.loads(docker("inspect", container, capture=True).stdout)[0] + assert info["Config"]["User"] not in ("", "root", "0"), "Container must run non-root" + assert info["State"]["Running"], "Default command exited" + if "Health" in info["State"]: + if info["State"]["Health"]["Status"] == "healthy": + docker( + "exec", + container, + "python", + "-c", + "from playwright.sync_api import sync_playwright; p = sync_playwright().start(); b = p.chromium.launch(headless=True, args=['--no-sandbox']); b.close(); p.stop()", + ) + return + elif "Sleeping" in docker("logs", container, capture=True).stderr: + docker("exec", container, "python", "-m", "src", "--help") + return + time.sleep(1) + raise RuntimeError("Container did not become ready") + finally: + try: + docker("logs", container) + finally: + docker("rm", "--force", container) + + +if __name__ == "__main__": + main() diff --git a/tests/test_dependency_release.py b/tests/test_dependency_release.py new file mode 100644 index 0000000..2b21231 --- /dev/null +++ b/tests/test_dependency_release.py @@ -0,0 +1,109 @@ +"""Offline release-policy tests; never resolve packages or create releases.""" + +from scripts.dependency_release import ( + frontend_graph, + lock_graph, + next_version, + upgrade_constraints, +) + + +def test_hash_only_changes_do_not_release(): + before = "requests==2.34.2 \\\n --hash=sha256:old\n" + after = before.replace("old", "new") + assert lock_graph(before) == lock_graph(after) + + +def test_transitive_and_platform_changes_release(): + before = "requests==2.34.2\nurllib3==2.8.0 ; sys_platform == 'linux'\n" + assert lock_graph(before) != lock_graph(before.replace("2.8.0", "2.8.1")) + assert lock_graph(before) != lock_graph(before.replace("linux", "win32")) + + +def test_constraints_prevent_major_bumps_and_downgrades(): + content = "Flask==3.1.3\nalpha==0.15.2\ntorch==2.11.0+cpu ; sys_platform == 'linux'\n" + constraints = upgrade_constraints(content) + assert "flask>=3.1.3,<4\n" in constraints + assert "alpha>=0.15.2,<0.16\n" in constraints + assert "torch>=2.11.0,<3 ; sys_platform == 'linux'\n" in constraints + + +def test_development_only_frontend_updates_do_not_release(): + project = { + "dependencies": {"react": {"version": "18.3.1"}}, + "devDependencies": {"vite": {"version": "8.1.0"}}, + } + before = frontend_graph([project]) + project["devDependencies"]["vite"]["version"] = "8.1.1" + assert frontend_graph([project]) == before + + +def test_frontend_transitive_updates_release(): + project = { + "dependencies": { + "react": {"version": "18.3.1", "dependencies": {"scheduler": {"version": "0.23.0"}}} + } + } + before = frontend_graph([project]) + project["dependencies"]["react"]["dependencies"]["scheduler"]["version"] = "0.23.1" + assert frontend_graph([project]) != before + + +def test_version_uses_latest_stable_tag(): + assert next_version("1.2.1", ["v1.2.2", "v2.0.0-rc.1", "notes"]) == "1.2.3" + assert next_version("0.1.0", ["v1.0.1"]) == "1.0.2" + + +def test_single_component_calendar_versions(): + assert ( + upgrade_constraints("openai-whisper==20250625\n") == "openai-whisper>=20250625,<20250626\n" + ) + + +def test_updater_enforces_age_and_production_only_release(tmp_path, monkeypatch): + import json + + from scripts import dependency_release + + (tmp_path / ".github").mkdir() + (tmp_path / ".github/dependency-policy.json").write_text(json.dumps({"python": "3.12"})) + (tmp_path / "requirements.lock").write_text("requests==2.34.2\n") + (tmp_path / "requirements-dev.lock").write_text("requests==2.34.2\nruff==0.17.3\n") + result = tmp_path / "outputs" + monkeypatch.setenv("GITHUB_OUTPUT", str(result)) + calls = [] + + def fake_resolver(*command, cwd=None, capture=False): + calls.append(command) + assert command[command.index("--exclude-newer") + 1] == "3d" + assert "--generate-hashes" in command + assert "--prerelease" in command + if "requirements-dev.txt" in command: + (tmp_path / "requirements-dev.lock").write_text("requests==2.34.2\nruff==0.17.4\n") + + monkeypatch.setattr(dependency_release, "run", fake_resolver) + dependency_release.update(tmp_path) + assert len(calls) == 2 + assert result.read_text() == "changed=true\nrelease=false\n" + + +def test_runtime_transitive_update_releases(tmp_path, monkeypatch): + import json + + from scripts import dependency_release + + (tmp_path / ".github").mkdir() + (tmp_path / ".github/dependency-policy.json").write_text(json.dumps({"python": "3.12"})) + old = "requests==2.34.2\nurllib3==2.8.0\n" + (tmp_path / "requirements.lock").write_text(old) + (tmp_path / "requirements-dev.lock").write_text(old) + result = tmp_path / "outputs" + monkeypatch.setenv("GITHUB_OUTPUT", str(result)) + + def fake_resolver(*command, cwd=None, capture=False): + name = command[command.index("--output-file") + 1] + (tmp_path / name).write_text(old.replace("2.8.0", "2.8.1")) + + monkeypatch.setattr(dependency_release, "run", fake_resolver) + dependency_release.update(tmp_path) + assert result.read_text() == "changed=true\nrelease=true\n" From 2ccf3189b7b05df32cd98f500bb4c2fc4c759132 Mon Sep 17 00:00:00 2001 From: luen Date: Tue, 3 Nov 2026 13:51:55 +1000 Subject: [PATCH 2/3] build: pin the dependency resolver image by digest --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 039e46e..5f169f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM python:3.15.0-alpine3.24 AS build WORKDIR /src -COPY --from=ghcr.io/astral-sh/uv:0.13.7 /uv /usr/local/bin/uv +COPY --from=ghcr.io/astral-sh/uv:0.13.7@sha256:96f40d3904aad8d0bd010539001d36c8e2188b981e1334471a90c4a1d93bb490 /uv /usr/local/bin/uv RUN python -m venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" From 95066b607e6b0f35efe363bdaad8147f41f520bc Mon Sep 17 00:00:00 2001 From: luen Date: Tue, 3 Nov 2026 14:03:23 +1000 Subject: [PATCH 3/3] fix: prevent older release retries from downgrading latest --- .github/workflows/docker-release.yml | 11 ++++++++ AGENTS.md | 2 +- README.md | 10 ++++---- scripts/dependency_release.py | 38 ++++++++++++++++++++++++++-- tests/test_dependency_release.py | 27 ++++++++++++++++++++ 5 files changed, 80 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 9c9977a..d127332 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -65,6 +65,9 @@ jobs: contents: write packages: write steps: + - uses: actions/checkout@v7 + with: + ref: ${{ needs.tag.outputs.sha }} - uses: docker/setup-buildx-action@v4 - uses: docker/login-action@v4 with: @@ -87,7 +90,15 @@ jobs: GH_REPO: ${{ github.repository }} TAG: ${{ needs.tag.outputs.tag }} run: gh release view "$TAG" || gh release create "$TAG" --verify-tag --generate-notes + - name: Check published stable release order + id: latest + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + TAG: ${{ needs.tag.outputs.tag }} + run: python scripts/dependency_release.py latest --tag "$TAG" - name: Advance Watchtower latest tags + if: steps.latest.outputs.advance_latest == 'true' env: REPOSITORY: ${{ github.repository }} TAG: ${{ needs.tag.outputs.tag }} diff --git a/AGENTS.md b/AGENTS.md index e8536a5..c4696a4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -99,4 +99,4 @@ Before merging any pull request: ## Dependency release policy -Images and CI install hash-pinned `requirements*.lock`; direct constraints remain in `requirements*.txt`. Regenerate with `python scripts/dependency_release.py update` using pinned uv (and pnpm for the podcast frontend). Preserve the three-day release age, bounded upgrades, production-graph release decision, and exact-commit validation in the nightly workflows. Developer-only updates must not publish a release. Container checks use native ARM64 and AMD64 runners with no credentials or external-service access. +Images and CI install hash-pinned `requirements*.lock`; direct constraints remain in `requirements*.txt`. Regenerate with `python scripts/dependency_release.py update` using pinned uv. Preserve the three-day release age, bounded upgrades, production-graph release decision, and exact-commit validation in the nightly workflows. Developer-only updates must not publish a release. Container checks use native ARM64 and AMD64 runners with no credentials or external-service access. diff --git a/README.md b/README.md index 36467e2..48fc24d 100644 --- a/README.md +++ b/README.md @@ -87,12 +87,12 @@ docker compose ps Keep the same Compose project name and existing volumes/bind mounts. Keep your `.env` and credentials; do not delete production data. The existing Watchtower installation can follow `latest` using the containers' `com.centurylinklabs.watchtower.enable=true` labels. If Watchtower filters names or scopes, include these containers in that configuration. No second Watchtower instance is needed. Watchtower applies new images, while future Compose and environment changes still need `git pull` and `docker compose up`. GHCR packages must be public for anonymous pulls; alternatively configure registry authentication in Docker and Watchtower. -Use the Compose tag variable (`SCHOLAR_IMAGE_TAG` for Scholar, `IMAGE_TAG` for the other apps) to pin both services to a published `vMAJOR.MINOR.PATCH` tag for rollback. Local builds use `docker compose -f docker-compose.yml -f docker-compose.build.yml up -d --build` (Scholar must first build its base service with the same two files). +Set `IMAGE_TAG` in `.env` to a published `vMAJOR.MINOR.PATCH` tag to pin the digest image or roll back. Local builds use `docker compose -f docker-compose.yml -f docker-compose.build.yml up -d --build`. -`docker-release.yml` publishes stable `v*` tag pushes, manual runs with an existing version tag, and calls from the nightly updater. It checks the exact release commit, validates both native architectures without secrets or upstream services, publishes the GitHub release, then updates the multi-platform `latest` tags. To publish manually, push an unused stable version tag on `main`, or rerun the Docker release workflow with that existing tag. The normal `GITHUB_TOKEN` needs contents/packages write permission; no PAT is required. Tag publication created by `GITHUB_TOKEN` does not trigger other workflows, so nightly calls the reusable release workflow explicitly. +`docker-release.yml` publishes stable `v*` tag pushes, manual runs with an existing version tag, and calls from the nightly updater. It checks the exact release commit, validates both native architectures without secrets or upstream services, publishes the GitHub release, then updates the multi-platform `latest` tag only if no newer stable release has been published. Rerunning an older release leaves `latest` unchanged. To publish manually, push an unused stable version tag on `main`, or rerun the Docker release workflow with that existing tag. The normal `GITHUB_TOKEN` needs contents/packages write permission; no PAT is required. Tag publication created by `GITHUB_TOKEN` does not trigger other workflows, so nightly calls the reusable release workflow explicitly. -Nightly updates run at 00:37 Australia/Brisbane. Python direct constraints live in `requirements.txt` and `requirements-dev.txt`; their generated `requirements.lock` and `requirements-dev.lock` pin the full graph with hashes. uv excludes versions uploaded in the last **three days** and keeps upgrades within each locked package's major (within its minor for 0.x), without downgrading. The podcast frontend uses pinned pnpm, a frozen lockfile in CI/Docker, and `minimumReleaseAge: 4320` for direct and transitive packages. The age gate reduces exposure to newly compromised releases; it does not guarantee package safety. +Nightly updates run at 00:37 Australia/Brisbane. Python direct constraints live in `requirements.txt` and `requirements-dev.txt`; their generated `requirements.lock` and `requirements-dev.lock` pin the full graph with hashes. uv excludes versions uploaded in the last **three days** and keeps upgrades within each locked package's major (within its minor for 0.x), without downgrading. The age gate reduces exposure to newly compromised releases; it does not guarantee package safety. -Only a changed **production** Python graph or podcast frontend production graph creates a patch version, tag, GitHub release, and image. This includes transitive and platform-specific runtime changes. Developer tooling, frontend devDependencies, and hash-only lock changes are committed after checks but do not release. With no changes, the run does nothing. Tests, lint, and a local production image smoke test run before a production update is committed; the release then checks both architectures. The bot refuses to rebase if `main` changed during validation, and pushes the tested commit/tag atomically. Branch rules must allow this bot to push dependency commits to `main`; failures remain visible in Actions rather than bypassing protections. +Only a changed **production** Python graph creates a patch version, tag, GitHub release, and image. This includes transitive and platform-specific runtime changes. Developer tooling and hash-only lock changes are committed after checks but do not release. With no changes, the run does nothing. Tests, lint, and a local production image smoke test run before a production update is committed; the release then checks both architectures. The bot refuses to rebase if `main` changed during validation, and pushes the tested commit/tag atomically. Branch rules must allow this bot to push dependency commits to `main`; failures remain visible in Actions rather than bypassing protections. -To refresh manually, install `uv==0.13.7` (and `pnpm@12.15.0` for the podcast frontend), then run `python scripts/dependency_release.py update`. Do not edit generated lockfiles by hand. Nightly uses existing stable tags when choosing the next patch version, even if project metadata previously lagged behind a release. +To refresh manually, install `uv==0.13.7`, then run `python scripts/dependency_release.py update`. Do not edit generated lockfiles by hand. Nightly uses existing stable tags when choosing the next patch version, even if project metadata previously lagged behind a release. diff --git a/scripts/dependency_release.py b/scripts/dependency_release.py index f32fe66..188b62a 100644 --- a/scripts/dependency_release.py +++ b/scripts/dependency_release.py @@ -63,6 +63,34 @@ def next_version(project_version: str, tags: list[str]) -> str: return f"{major}.{minor}.{patch + 1}" +def should_advance_latest(tag: str, published_tags: list[str]) -> bool: + """Older release retries must not downgrade Watchtower deployments.""" + match = VERSION.fullmatch(tag) + if match is None: + raise ValueError(f"Not a stable version tag: {tag}") + candidate = tuple(map(int, match.groups())) + return all( + candidate >= tuple(map(int, published.groups())) + for value in published_tags + if (published := VERSION.fullmatch(value)) + ) + + +def latest(root: Path, tag: str) -> None: + """Compare all published stable releases before updating the latest image.""" + tags = run( + "gh", + "api", + "repos/{owner}/{repo}/releases", + "--paginate", + "--jq", + ".[] | select(.draft == false and .prerelease == false) | .tag_name", + cwd=root, + capture=True, + ).splitlines() + output(advance_latest=should_advance_latest(tag, tags)) + + def run(*command, cwd=None, capture=False): """Run a tool and fail the workflow if resolution or validation fails.""" executable = shutil.which(command[0]) @@ -196,10 +224,16 @@ def bump(root: Path) -> None: def main() -> None: """Run from the repository root: update, or bump after validation.""" parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument("command", choices=("update", "bump")) + parser.add_argument("command", choices=("update", "bump", "latest")) + parser.add_argument("--tag", help="Stable release tag to consider for latest") args = parser.parse_args() root = Path(__file__).resolve().parents[1] - (update if args.command == "update" else bump)(root) + if args.command == "latest": + if args.tag is None: + parser.error("latest requires --tag") + latest(root, args.tag) + else: + (update if args.command == "update" else bump)(root) if __name__ == "__main__": diff --git a/tests/test_dependency_release.py b/tests/test_dependency_release.py index 2b21231..f258556 100644 --- a/tests/test_dependency_release.py +++ b/tests/test_dependency_release.py @@ -4,6 +4,7 @@ frontend_graph, lock_graph, next_version, + should_advance_latest, upgrade_constraints, ) @@ -60,6 +61,32 @@ def test_single_component_calendar_versions(): ) +def test_older_release_retry_cannot_downgrade_latest(): + assert not should_advance_latest("v0.0.3", ["v0.0.4", "v0.0.3"]) + assert not should_advance_latest("v1.9.0", ["v1.10.0"]) + assert should_advance_latest("v1.10.0", ["v1.9.0", "v1.10.0"]) + assert should_advance_latest("v1.10.0", ["v1.9.0", "v2.0.0-rc.1"]) + assert should_advance_latest("v0.0.3", []) + + +def test_latest_queries_all_published_releases(tmp_path, monkeypatch): + from scripts import dependency_release + + result = tmp_path / "outputs" + monkeypatch.setenv("GITHUB_OUTPUT", str(result)) + + def fake_github(*command, cwd=None, capture=False): + assert command[:3] == ("gh", "api", "repos/{owner}/{repo}/releases") + assert "--paginate" in command + assert "select(.draft == false and .prerelease == false)" in command[-1] + assert capture + return "v0.0.4\nv0.0.3\n" + + monkeypatch.setattr(dependency_release, "run", fake_github) + dependency_release.latest(tmp_path, "v0.0.3") + assert result.read_text() == "advance_latest=false\n" + + def test_updater_enforces_age_and_production_only_release(tmp_path, monkeypatch): import json