Skip to content

Commit 3663440

Browse files
Technologicatclaude
andcommitted
pyproject, .github/workflows, .gitignore: align with fleet coverage convention
Two related cleanups, applied per the fleet sweep brief (unpythonic/briefs/fleet-sweep-coverage-and-deps.md): - Add [tool.coverage.run] to pyproject.toml: source = ["pyan"] and omit = ["*/tests/*"], so coverage reports cover only production code. Test files are excluded from analysis because pytest already reports pass/fail per test — coverage of tests just adds rows without insight. - Switch the coverage and CI workflows from ad-hoc `pip install pytest pytest-cov sphinx docutils && pip install -e .` to `pip install pdm && pdm install`. All four packages are already declared in [dependency-groups].dev, so `pdm install` covers them in one shot (default behavior includes the dev group), and a fresh `pdm install` on a developer's machine now matches what CI runs. Subsequent pytest/ruff invocations gain a `pdm run` prefix, since `pdm install` lands the binaries under `.venv/bin/` rather than on PATH. Also gitignore coverage.xml — already generated locally by the verify recipe, and a CI artifact uploaded to Codecov but not meant for the repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7c8d288 commit 3663440

4 files changed

Lines changed: 18 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ jobs:
3636
- name: Install dependencies
3737
run: |
3838
python -m pip install --upgrade pip
39-
pip install ruff pytest pytest-cov sphinx docutils
40-
pip install -e .
39+
pip install pdm
40+
pdm install
4141
- name: Lint with ruff
4242
run: |
43-
ruff check .
43+
pdm run ruff check .
4444
- name: Test with pytest
4545
run: |
46-
pytest tests/ -v
46+
pdm run pytest tests/ -v
4747
4848
build:
4949
needs: test

.github/workflows/coverage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
- name: Install dependencies
2323
run: |
2424
python -m pip install --upgrade pip
25-
pip install pytest pytest-cov sphinx docutils
26-
pip install -e .
25+
pip install pdm
26+
pdm install
2727
- name: Generate coverage report
2828
run: |
29-
pytest tests/ -v --cov-branch --cov-report=xml:coverage.xml
29+
pdm run pytest tests/ -v --cov-branch --cov-report=xml:coverage.xml
3030
- name: Upload coverage reports to Codecov
3131
uses: codecov/codecov-action@v6
3232
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ MANIFEST
1313
*.mypy_cache
1414
.python-version
1515
.coverage
16+
coverage.xml
1617
htmlcov/
1718
00_tmp/
1819
*.zip

pyproject.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ log_format = "%(asctime)s %(levelname)s %(message)s"
102102
log_date_format = "%Y-%m-%d %H:%M:%S"
103103
cache_dir = ".cache"
104104

105+
[tool.coverage.run]
106+
# Coverage signal is about which lines of *production code* run.
107+
# pytest already reports pass/fail/error per test, so coverage of
108+
# the test files themselves would just add rows to the report
109+
# without insight. Excluded via the omit glob below.
110+
source = ["pyan"]
111+
omit = [
112+
"*/tests/*",
113+
]
114+
105115
[tool.ruff]
106116
line-length = 120
107117
target-version = "py310"

0 commit comments

Comments
 (0)