Skip to content

Commit 3f663a1

Browse files
Technologicatclaude
andcommitted
coverage: invoke via pdm run for consistency with test runner
Match the convention that CLAUDE.md already documents (line 27: "Prefix commands with `pdm run` if the venv is not active"). - `.github/workflows/coverage.yml`: replace the `pdm use --venv in-project && source .venv/bin/activate && ...` dance with `pdm run python -m coverage ...`. Besides being more concise, this removes a hardcoded POSIX venv layout (`.venv/bin/activate`) that wouldn't work on Windows. - `measure_coverage.sh`: likewise, prepend `pdm run ` to the bare `coverage` invocations so the script no longer assumes an already-activated venv. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 00f953f commit 3f663a1

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,8 @@ jobs:
4343
pdm run python -m pip install coverage
4444
- name: Generate coverage report
4545
run: |
46-
pdm use --venv in-project
47-
source .venv/bin/activate
48-
python -m coverage run --source=. -m runtests
49-
python -m coverage xml
46+
pdm run python -m coverage run --source=. -m runtests
47+
pdm run python -m coverage xml
5048
- name: Upload coverage to Codecov
5149
uses: codecov/codecov-action@v6
5250
with:

measure_coverage.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# https://coverage.readthedocs.io/en/coverage-5.2.1/#quick-start
77

88
echo -ne "Measuring...\n"
9-
coverage run --source=. -m runtests
9+
pdm run coverage run --source=. -m runtests
1010
echo -ne "Generating report...\n"
11-
coverage html
11+
pdm run coverage html
1212
echo -ne "Done. Open htmlcov/index.html in your browser to view.\n"

0 commit comments

Comments
 (0)