@@ -20,20 +20,22 @@ requires-python = ">=3.10"
2020
2121[project.optional-dependencies]
2222dev = [
23+ "build",
2324 "copier",
2425 {% if type_checker =="mypy" %} "mypy",
2526 {% endif %}{% if sphinx %} "myst-parser",
2627 {% endif %} "pipdeptree",
2728 "pre-commit",
2829 {% if sphinx %} "pydata-sphinx-theme>=0.12",
29- {% endif %} {% if type_checker =="pyright" %} "pyright",
30+ {% endif %}{% if type_checker =="pyright" %} "pyright",
3031 {% endif %} "pytest>8.3.4",
3132 "pytest-cov",
3233 "ruff",
3334 {% if sphinx %} "sphinx-autobuild",
3435 "sphinx-copybutton",
3536 "sphinx-design",
3637 {% endif %} "tox-uv",
38+ "twine",
3739 "types-mock",
3840]
3941
@@ -79,55 +81,73 @@ source = ["src", "**/site-packages/"]
7981
8082[tool.tox]
8183skipsdist = true
84+ requires = ["tox-uv>=1.25.0"]
85+ # envs to runs automatically with tox -p
86+ env_list = ["pre-commit", "type-checking", "docs"] # "tests"]
87+
88+ [tool.tox.env]
89+ passenv = { "*" = "" }
90+ # Include setuptools, pip, ... in the tox envs
91+ uv_seed = { enabled = true }
8292
8393[tool.tox.env.pre-commit]
8494description = "Run pre-commit"
85- direct = true
8695allowlist_externals = ["pre-commit"]
8796commands = [
8897 [
8998 "pre-commit",
9099 "run",
91100 #"--all-files",
92101 "--show-diff-on-failure",
93- "{ posargs}" ,
102+ { replace = " posargs", default = [], extend = true } ,
94103 ],
95104]
96105
97106[tool.tox.env.type-checking]
98107description = "Run type-checking"
99- direct = true
100108allowlist_externals = ["{{ type_checker }}"]
101- commands = [["{{ type_checker }}", "src", "{posargs}"]]
109+ # needed otherwise throws reportUnknownMemberType errors
110+ deps = ["pytest"]
111+ commands = [
112+ [
113+ "{{ type_checker }}",
114+ "src",
115+ "tests",
116+ { replace = "posargs", default = [
117+ ], extend = true },
118+ ],
119+ ]
102120
103121[tool.tox.env.tests]
104122description = "Run tests"
105- direct = true
106123allowlist_externals = ["pytest"]
107124commands = [
108125 [
109126 "pytest",
110- "--cov={{ package_name}}",
127+ "-vv",
128+ "--cov={{ package_name }}",
111129 "--cov-report",
112130 "term",
113131 "--cov-report",
114132 "xml:cov.xml",
115- "{posargs}",
133+ { replace = "posargs", default = [
134+ ], extend = true },
116135 ],
117136]
118137
119138{% if sphinx %} [tool.tox.env.docs]
120139description = "Run docs"
121- direct = true
122140allowlist_externals = ["sphinx-build", "sphinx-autobuild"]
123141commands = [
124142 [
125- "sphinx-{posargs:build}",
126- "-EW",
127- "--keep-going",
143+ "sphinx-build",
128144 "-T",
129145 "docs",
130146 "build/html",
147+ { replace = "posargs", default = [
148+ "-EW",
149+ "--keep-going",
150+ ], extend = true },
131151 ],
132152]
133153{% endif %}
0 commit comments