Skip to content

Commit 3e242bf

Browse files
authored
Update coverage, use the new run.patch setting (#676)
* Update coverage, use the new `run.patch` setting * Fix cleanup
1 parent 53fb451 commit 3e242bf

File tree

4 files changed

+117
-73
lines changed

4 files changed

+117
-73
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
env:
3232
FAST: ${{ startsWith(matrix.python-version, 'pypy') && '1' || '' }}
3333
run: |
34-
just --set python ${{ startsWith(matrix.python-version, 'pypy') && matrix.python-version || format('python{0}', matrix.python-version) }} cov
34+
just python=${{ startsWith(matrix.python-version, 'pypy') && matrix.python-version || format('python{0}', matrix.python-version) }} covcleanup="false" cov
3535
3636
- name: Upload coverage data
3737
uses: actions/upload-artifact@v4

Justfile

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
python := ""
2+
covcleanup := "true"
23

34
lint:
45
uv run -p python3.13 --group lint ruff check src/ tests bench
@@ -7,9 +8,30 @@ lint:
78
test *args="-x --ff -n auto tests":
89
uv run {{ if python != '' { '-p ' + python } else { '' } }} --all-extras --group test pytest {{args}}
910

11+
testall:
12+
just python=python3.9 test
13+
just python=python3.10 test
14+
just python=python3.11 test
15+
just python=python3.12 test
16+
just python=python3.13 test
17+
just python=pypy3.9 test
18+
1019
cov *args="-x --ff -n auto tests":
11-
@uv run {{ if python != '' { '-p ' + python } else { '' } }} python -c 'import pathlib, site; pathlib.Path(f"{site.getsitepackages()[0]}/cov.pth").write_text("import coverage; coverage.process_startup()")'
12-
COVERAGE_PROCESS_START={{justfile_directory()}}/pyproject.toml uv run {{ if python != '' { '-p ' + python } else { '' } }} --all-extras --group test coverage run -m pytest {{args}}
20+
uv run {{ if python != '' { '-p ' + python } else { '' } }} --all-extras --group test coverage run -m pytest {{args}}
21+
{{ if covcleanup == "true" { "uv run coverage combine" } else { "" } }}
22+
{{ if covcleanup == "true" { "uv run coverage report" } else { "" } }}
23+
{{ if covcleanup == "true" { "@rm .coverage*" } else { "" } }}
24+
25+
covall:
26+
just python=python3.9 covcleanup=false cov
27+
just python=python3.10 covcleanup=false cov
28+
just python=python3.11 covcleanup=false cov
29+
just python=python3.12 covcleanup=false cov
30+
just python=python3.13 covcleanup=false cov
31+
just python=pypy3.10 covcleanup=false cov
32+
uv run coverage combine
33+
uv run coverage report
34+
@rm .coverage*
1335

1436
bench-cmp:
1537
uv run pytest bench --benchmark-compare

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ addopts = "-l --benchmark-sort=fullname --benchmark-warmup=true --benchmark-warm
103103
parallel = true
104104
source_pkgs = ["cattrs", "tests"]
105105
core = "sysmon"
106+
patch = ["subprocess"]
106107

107108
[tool.coverage.report]
108109
show_missing = true

0 commit comments

Comments
 (0)