Skip to content

Commit 9af7661

Browse files
committed
Add parallel uv pytest matrix runner
Introduce scripts/run-pytest-matrix.py to run pytest across supported Python versions in parallel via uv. The runner now: - keeps per-version virtualenvs under .runner/.venv-* - wipes only .runner/outcome-*.txt on each run by default - supports --recreate-envs for full env rebuilds - stores stdout/stderr for failed runs in .runner/outcome-<version>.txt - shows a live spinner with white pending/running, early red failure hints, and final green/red based on actual exit status Document the matrix command in README.rst and ignore .runner artifacts.
1 parent 4d8d6d2 commit 9af7661

File tree

5 files changed

+507
-0
lines changed

5 files changed

+507
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ docs/_build
77
__pycache__
88
.python-version
99
mockito/_version.py
10+
.runner/

README.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,19 @@ to your computer, then run ``uv sync`` in the root directory. Example usage::
8787

8888
uv run pytest
8989

90+
To run the full supported Python matrix in parallel::
91+
92+
uv run python scripts/run-pytest-matrix.py
93+
94+
To run only selected versions::
95+
96+
uv run python scripts/run-pytest-matrix.py -p 3.8 -p 3.14
97+
98+
The matrix runner keeps per-version virtual environments in ``.runner/``
99+
(``.venv-3.8``, etc.) so runs can execute safely in parallel while only
100+
``outcome-*.txt`` files are wiped each run. Use ``--recreate-envs`` to
101+
rebuild those environments.
102+
90103
Note: development and docs tooling target Python >=3.12, while the library itself
91104
supports older Python versions at runtime.
92105

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ dev = [
3030
"ipython>=7.34.0",
3131
"mypy>=1.4.1",
3232
"numpy>=1.21.6",
33+
"pyyaml>=6.0.2",
3334
"pytest>=7.4.4",
35+
"types-pyyaml>=6.0.12.20241230",
3436
]
3537
docs = [
3638
"sphinx>=7.4.7; python_version >= '3.12'",

0 commit comments

Comments
 (0)