Skip to content

Commit f0907e6

Browse files
authored
Replace tox by uv (#146)
1 parent 44638b9 commit f0907e6

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

.github/workflows/tests.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,14 @@ jobs:
3434
with:
3535
python-version: ${{ matrix.python-version }}
3636
allow-prereleases: true
37-
- name: Install tox
38-
run: pipx install tox && pipx inject tox tox-uv
37+
- name: Install uv
38+
uses: astral-sh/setup-uv@v4
39+
- name: Install dependencies
40+
run: |
41+
uv venv --python ${{ matrix.python-version }}
42+
uv pip install . -r tests/requirements.txt
3943
- name: Run the test suite
40-
run: tox run -e py${{ matrix.python-version }} -- -vv --color=yes
44+
run: uv run pytest -vv --color=yes --cov
4145
- name: Upload coverage report if tests fail.
4246
uses: actions/upload-artifact@v4
4347
with:

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ typo fixes where an issue may not be needed).
3838

3939
## Testing
4040

41-
Running all the tests can be done with `tox run -e py310` (or any other interpreter version). This
42-
also runs the test coverage to ensure 100% of the code is covered by tests.
41+
Running all the tests can be done with `pytest --cov`. This also runs the test coverage to ensure
42+
100% of the code is covered by tests. You can also run individual tests with
43+
`pytest -k the_name_of_your_test`.
4344

44-
Alternatively, you can run `coverage run -m pytest && coverage report` with the virtual environment
45-
activated. You can also run a individual tests with `pytest -k the_name_of_your_test`.
45+
The helper script `scripts/run-tests` runs the tests with coverage on all supported python versions.
4646

4747
### Code quality
4848

pyproject.toml

-12
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,6 @@ include = ["CHANGELOG.md", "CONTRIBUTING.md", "requirements-dev.txt", "rich_argp
4444
[tool.hatch.build.targets.wheel]
4545
packages = ["rich_argparse"]
4646

47-
[tool.tox]
48-
requires = ["tox>=4.21.0"]
49-
env_list = ["py38", "py39", "py310", "py311", "py312", "py313", "py314"]
50-
skip_missing_interpreters = true
51-
env_run_base.deps = ["-rtests/requirements.txt"]
52-
env_run_base.set_env = {COLUMNS="80"}
53-
env_run_base.commands = [
54-
["coverage", "run", "-m", "pytest", {replace="posargs", extend=true}],
55-
["coverage", "report"],
56-
["coverage", "html"],
57-
]
58-
5947
[tool.ruff]
6048
line-length = 100
6149

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
-e .
22
-r tests/requirements.txt
33
pre-commit
4-
tox
4+
uv

scripts/run-tests

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/env bash
2+
3+
set -euxo pipefail
4+
5+
for python in 3.{8..14}; do
6+
uvx --python=${python} --with=. --with-requirements=tests/requirements.txt pytest --cov
7+
done

tests/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pytest
22
coverage[toml]
33
covdefaults
4+
pytest-cov

0 commit comments

Comments
 (0)