Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/code_changes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,17 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
- name: Check formatting
run: uvx ruff format --check .
# With the ruff that uv.lock pins, so a new ruff release cannot change
# what Lint accepts until the lock is updated.
run: |
set -euo pipefail
ruff=$(uv export --frozen --extra dev --no-hashes --no-header | { grep -E '^ruff==' || true; } | cut -d' ' -f1)
if [ "$(printf '%s' "$ruff" | grep -c '^ruff==')" != 1 ]; then
echo "::error::uv.lock should pin exactly one ruff; found: ${ruff:-none}"
exit 1
fi
echo "RUFF=$ruff" >> "$GITHUB_ENV"
uvx --from "$ruff" ruff format --check .
- name: Lint
# The ruff rules pyproject.toml selects, then two pyflakes rules it
# ignores, checked in the package: F811, a definition that a later
Expand All @@ -89,8 +99,8 @@ jobs:
# notice 16), and F821, an undefined name. Neither has a finding
# in the package today.
run: |
uvx ruff check .
uvx ruff check --select F811,F821 policyengine_uk
uvx --from "$RUFF" ruff check .
uvx --from "$RUFF" ruff check --select F811,F821 policyengine_uk
# The same suite as pull requests (test-suite.yaml), on the merged commit.
Test:
needs: Tested
Expand Down
30 changes: 17 additions & 13 deletions .github/workflows/pr_code_changes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,17 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
- name: Check formatting
run: uvx ruff format --check .
# With the ruff that uv.lock pins, so a new ruff release cannot change
# what Lint accepts until the lock is updated.
run: |
set -euo pipefail
ruff=$(uv export --frozen --extra dev --no-hashes --no-header | { grep -E '^ruff==' || true; } | cut -d' ' -f1)
if [ "$(printf '%s' "$ruff" | grep -c '^ruff==')" != 1 ]; then
echo "::error::uv.lock should pin exactly one ruff; found: ${ruff:-none}"
exit 1
fi
echo "RUFF=$ruff" >> "$GITHUB_ENV"
uvx --from "$ruff" ruff format --check .
- name: Lint
# The ruff rules pyproject.toml selects, then two pyflakes rules it
# ignores, checked in the package: F811, a definition that a later
Expand All @@ -119,8 +129,8 @@ jobs:
# notice 16), and F821, an undefined name. Neither has a finding
# in the package today.
run: |
uvx ruff check .
uvx ruff check --select F811,F821 policyengine_uk
uvx --from "$RUFF" ruff check .
uvx --from "$RUFF" ruff check --select F811,F821 policyengine_uk
- name: No agent working notes at the repository root
# Agent jobs keep their working notes at the root of their
# worktree, and #2376's REPORT.md and PROGRESS.md reached main by
Expand Down Expand Up @@ -150,16 +160,10 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install package
run: uv pip install -e .[dev] --system
- name: Install policyengine
run: uv pip install policyengine --system
# The environment the tests use: uv.lock with the dev extra (which
# includes jupyter-book), so a new release cannot change the build.
- name: Install the locked environment
uses: ./.github/actions/test-environment
- name: Test documentation builds
run: make documentation
# The YAML tests, the Python tests on five runners, and the check that
Expand Down
18 changes: 4 additions & 14 deletions .github/workflows/pr_docs_changes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,9 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'

- name: Install package
run: uv pip install -e .[dev] --system
- name: Install policyengine
run: uv pip install policyengine --system
- name: Install JB
run: uv pip install "jupyter-book>=2.0.0a0" --system
# The environment the tests use: uv.lock with the dev extra (which
# includes jupyter-book), so a new release cannot change the build.
- name: Install the locked environment
uses: ./.github/actions/test-environment
- name: Test documentation builds
run: make documentation
16 changes: 13 additions & 3 deletions .github/workflows/versioning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,17 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
- name: Check formatting
run: uvx ruff format --check .
# With the ruff that uv.lock pins, so a new ruff release cannot change
# what Lint accepts until the lock is updated.
run: |
set -euo pipefail
ruff=$(uv export --frozen --extra dev --no-hashes --no-header | { grep -E '^ruff==' || true; } | cut -d' ' -f1)
if [ "$(printf '%s' "$ruff" | grep -c '^ruff==')" != 1 ]; then
echo "::error::uv.lock should pin exactly one ruff; found: ${ruff:-none}"
exit 1
fi
echo "RUFF=$ruff" >> "$GITHUB_ENV"
uvx --from "$ruff" ruff format --check .
- name: Lint
# The ruff rules pyproject.toml selects, then two pyflakes rules it
# ignores, checked in the package: F811, a definition that a later
Expand All @@ -278,8 +288,8 @@ jobs:
# notice 16), and F821, an undefined name. Neither has a finding
# in the package today.
run: |
uvx ruff check .
uvx ruff check --select F811,F821 policyengine_uk
uvx --from "$RUFF" ruff check .
uvx --from "$RUFF" ruff check --select F811,F821 policyengine_uk

Compat:
# What a user gets: the wheel, with the newest dependencies it allows,
Expand Down
1 change: 1 addition & 0 deletions changelog.d/ci-lint-docs-from-lock.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Lint and the documentation build now install from uv.lock, as the tests already do, so a new release of ruff, jupyter-book or another dependency cannot change what pull requests are checked against.
Loading