Skip to content

Commit f72da85

Browse files
committed
🔨 streamlined tox config
1 parent 5fc329d commit f72da85

File tree

1 file changed

+36
-145
lines changed

1 file changed

+36
-145
lines changed

‎tox.toml

Lines changed: 36 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -1,165 +1,56 @@
1-
isolated_build = true
2-
env_list = ["repo-review", "pre-commit", "3.10", "3.11", "3.12", "3.13"]
1+
min_version = "4"
2+
requires = ["tox-uv>=1"]
3+
env_list = ["lint", "pyright", "mypy", "3.13", "3.12", "3.11", "3.10"]
34

45
[env_run_base]
5-
runner = "uv-venv-lock-runner"
66
description = "stubtest with {base_python}"
7-
allowlist_externals = ["poe"]
8-
commands = [["poe", "stubtest"]]
7+
runner = "uv-venv-lock-runner"
8+
dependency_groups = ["type"]
9+
uv_sync_flags = ["--no-editable"]
10+
commands = [
11+
[
12+
"stubtest",
13+
"--ignore-unused-allowlist",
14+
"--allowlist=.mypyignore",
15+
"--mypy-config-file=pyproject.toml",
16+
"--concise",
17+
{replace = "posargs", default = ["scipy"], extend = true},
18+
],
19+
]
920

1021
[env.pre-commit]
11-
runner = "uv-venv-lock-runner"
1222
description = "pre-commit"
13-
allowlist_externals = ["poe"]
14-
commands = [["poe", "pre-commit"]]
15-
16-
[env.repo-review]
17-
runner = "uv-venv-lock-runner"
18-
description = "repo-review"
19-
allowlist_externals = ["poe"]
20-
commands = [["poe", "repo-review"]]
23+
skip_install = true
24+
deps = ["pre-commit-uv>=4.1.4"]
25+
allowlist_externals = ["pre-commit"]
26+
commands = [["pre-commit", "run", "--all-files"]]
2127

2228
[env.lint]
2329
description = "lint"
30+
runner = "uv-venv-lock-runner"
2431
dependency_groups = ["lint"]
2532
commands = [
26-
[
27-
"ruff",
28-
"format",
29-
"--check",
30-
],
31-
[
32-
"ruff",
33-
"check",
34-
"--show-fixes",
35-
],
36-
[
37-
"mdformat",
38-
"--check",
39-
"CODE_OF_CONDUCT.md",
40-
"CONTRIBUTING.md",
41-
"README.md",
42-
"SECURITY.md",
43-
"tests/README.md",
44-
"codegen/README.md",
45-
],
46-
[
47-
"repo-review",
48-
".",
49-
],
50-
]
51-
52-
[env.basedmypy]
53-
description = "basedmypy"
54-
dependency_groups = ["typecheck"]
55-
commands = [
56-
[
57-
"uv",
58-
"pip",
59-
"freeze",
60-
],
61-
[
62-
"uv",
63-
"run",
64-
"--frozen",
65-
"--no-editable",
66-
"--isolated",
67-
"--refresh-package=scipy-stubs",
68-
"mypy",
69-
"--config-file=pyproject.toml",
70-
"scipy-stubs",
71-
"codegen",
72-
],
33+
["repo-review", "."],
34+
["ruff", "check", "--show-fixes"],
35+
["ruff", "format", "--check"],
7336
]
7437

75-
[env.basedpyright]
38+
[env.pyright]
7639
description = "basedpyright"
77-
dependency_groups = ["typecheck"]
78-
commands = [["uv", "pip", "freeze"], ["basedpyright", "scipy-stubs", "codegen"]]
79-
80-
[env.min-versions-test]
81-
description = "min versions tests"
82-
dependency_groups = ["typecheck"]
83-
commands = [["python", "--version"], ["uv", "pip", "show", "numpy"]]
84-
85-
[env.basedmypy-tests]
86-
description = "basedmypy tests"
87-
dependency_groups = ["typecheck"]
88-
commands = [
89-
[
90-
"uv",
91-
"pip",
92-
"freeze",
93-
],
94-
[
95-
"uv",
96-
"run",
97-
"--frozen",
98-
"--no-editable",
99-
"--isolated",
100-
"--refresh-package=scipy-stubs",
101-
"mypy",
102-
"--config-file=pyproject.toml",
103-
"scipy-stubs",
104-
"codegen",
105-
],
106-
]
107-
108-
[env.basedpyright-tests]
109-
description = "basedpyright tests"
110-
dependency_groups = ["typecheck"]
111-
commands = [["uv", "pip", "freeze"], ["basedpyright", "tests"]]
112-
113-
[env.stubtest]
114-
description = "stubtest"
115-
dependency_groups = ["typecheck"]
116-
commands = [
117-
[
118-
"uv",
119-
"pip",
120-
"freeze",
121-
],
122-
[
123-
"uv",
124-
"run",
125-
"--frozen",
126-
"--no-editable",
127-
"--isolated",
128-
"--refresh-package=scipy-stubs",
129-
"stubtest",
130-
"--mypy-config-file=pyproject.toml",
131-
"--allowlist=.mypyignore",
132-
"--ignore-unused-allowlist",
133-
"scipy",
134-
],
135-
]
40+
runner = "uv-venv-lock-runner"
41+
dependency_groups = ["type"]
42+
commands = [["basedpyright"]]
13643

13744
[env.mypy]
138-
description = "Run mypy"
139-
dependency_groups = ["typecheck"]
45+
description = "basedmypy"
46+
runner = "uv-venv-lock-runner"
47+
dependency_groups = ["type"]
14048
commands = [
14149
[
142-
"uv",
143-
"pip",
144-
"freeze",
145-
],
146-
[
147-
"uv",
148-
"run",
149-
"--no-sync",
15050
"mypy",
151-
"--config-file=pyproject.toml",
152-
".",
153-
],
51+
"--tb",
52+
"--hide-error-context",
53+
"--hide-error-code-links",
54+
{replace = "posargs", default = ["."], extend = true},
55+
]
15456
]
155-
156-
[env.pyright]
157-
description = "Run pyright"
158-
dependency_groups = ["typecheck"]
159-
commands = [["uv", "pip", "freeze"], ["uv", "run", "--no-sync", "basedpyright"]]
160-
161-
[env.typetest]
162-
description = "Run all type tests"
163-
depends = ["mypy", "pyright", "stubtest"]
164-
skip_install = true
165-
commands = []

0 commit comments

Comments
 (0)