Skip to content

Commit c875888

Browse files
authored
ci: fetch the ADR citation check from .github instead of keeping a copy (#145)
* ci: fetch the ADR citation check from .github instead of keeping a copy * ci: fetch the ADR check into the repo and run it without the repo's conftests or addopts
1 parent c948770 commit c875888

3 files changed

Lines changed: 12 additions & 111 deletions

File tree

‎.github/workflows/_checks.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
- run: uv python install 3.10
1616
- run: uv python pin 3.10
1717
- run: just install lint-ci
18+
- run: just adr-check
1819

1920
links:
2021
runs-on: ubuntu-latest

‎justfile‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ lint-ci:
1919
uv run ruff check --no-fix
2020
uv run ty check
2121

22+
adr_check_source := "https://raw.githubusercontent.com/modern-python/.github/main/tests/test_adr_citations.py"
23+
24+
# Tracks main on purpose: the shared check is unpinned.
25+
adr-check:
26+
#!/usr/bin/env sh
27+
set -eu
28+
dir="$(mktemp -d .adr-check.XXXXXX)"
29+
trap 'rm -rf "$dir"' EXIT
30+
curl -fsSL "{{ adr_check_source }}" -o "$dir/test_adr_citations.py"
31+
uv run --no-sync pytest --rootdir=. --noconftest -o addopts= "$dir/test_adr_citations.py"
32+
2233
# Run pytest with NO coverage (targeted runs won't trip the gate). Passes args through.
2334
test *args:
2435
uv run --no-sync pytest {{ args }}

‎tests/test_adr_citations.py‎

Lines changed: 0 additions & 111 deletions
This file was deleted.

0 commit comments

Comments
 (0)