Skip to content

Commit c022c8b

Browse files
committed
Rework tox to work with optional tox-uv
Signed-off-by: Samuel Monson <smonson@redhat.com>
1 parent 891e2b1 commit c022c8b

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ url = "https://download.pytorch.org/whl/cpu"
1717
explicit = true
1818

1919
[tool.uv.sources]
20-
torch = [
21-
{ index = "pytorch-cpu" },
22-
]
20+
torch = { index = "pytorch-cpu" }
2321

2422
# ************************************************
2523
# ********** Project Metadata **********

tox.ini

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,44 @@ min_version = 4.0
33
env_list = py3{10,11,12,13}
44

55

6-
[testenv]
6+
[testenv:tests]
77
description = Run all tests
8-
extras = dev
9-
groups = dev # Used instead of extras by tox-pdm
8+
dependency_groups = dev
109
commands =
11-
pytest tests/ {posargs}
10+
python -m pytest {posargs:tests/}
1211

1312

1413
[testenv:test-unit]
1514
description = Run unit tests
15+
base = tests
1616
commands =
1717
python -m pytest tests/unit {posargs}
1818

1919

2020
[testenv:test-integration]
2121
description = Run integration tests
22+
base = tests
2223
commands =
2324
python -m pytest tests/integration {posargs}
2425

2526

2627
[testenv:test-e2e]
2728
description = Run end-to-end tests
29+
base = tests
2830
commands =
2931
python -m pytest tests/e2e {posargs}
3032

3133

3234
[testenv:quality]
3335
description = Run all quality checks
36+
base = tests
3437
commands =
3538
ruff check
3639
python -m mdformat --check README.md DEVELOPING.md CONTRIBUTING.md CODE_OF_CONDUCT.md docs/ src/ tests/
3740

3841
[testenv:style]
3942
description = Run style checks and fixes
43+
base = tests
4044
commands =
4145
ruff format
4246
ruff check --fix
@@ -45,12 +49,14 @@ commands =
4549

4650
[testenv:types]
4751
description = Run type checks
52+
base = tests
4853
commands =
4954
mypy --check-untyped-defs {posargs}
5055

5156

5257
[testenv:links]
5358
description = Run link checks for root and docs markdown files
59+
base = tests
5460
commands =
5561
mkdocs-linkcheck ./
5662
mkdocs-linkcheck docs/
@@ -71,13 +77,12 @@ commands =
7177

7278
[testenv:clean]
7379
description = Clean up build, dist, and cache files
80+
runner = virtualenv
7481
skip_install = true
7582
env_log_dir = /tmp/.tox_clean
7683
allowlist_externals =
7784
find
7885
rm
79-
deps =
80-
groups =
8186
commands =
8287
rm -rf build
8388
rm -rf dist
@@ -93,6 +98,7 @@ commands =
9398

9499
[testenv:lock]
95100
description = Update pylock
101+
runner = virtualenv
96102
skip_install = true
97103
allowlist_externals = ./scripts/generate_pylock.sh
98104
deps = uv

0 commit comments

Comments
 (0)