Skip to content

Commit 2c483ce

Browse files
Better handling of linting/packaging dependencies
- Basic support for PEP 639 requires flit version 3.11. Specify it in a single place, the [build-system] section - tox should be able to read it from there. - Intoduce a new dependency group for linting, and instruct tox to use it to install linting dependencies. Dependency groups require tox 4.
1 parent 56223f6 commit 2c483ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ wheel = "wheel._commands:main"
4242
bdist_wheel = "wheel.bdist_wheel:bdist_wheel"
4343

4444
[dependency-groups]
45+
lint = ["pre-commit"]
4546
test = [
4647
"packaging >= 26.0",
4748
"pytest >= 6.0.0",
@@ -121,6 +122,7 @@ mypy-init-return = true
121122

122123
[tool.tox]
123124
env_list = ["py39", "py310", "py311", "py312", "py313", "py314", "pypy3", "lint", "pkg"]
125+
requires = ["tox>=4"]
124126
skip_missing_interpreters = true
125127

126128
[tool.tox.env_run_base]
@@ -131,11 +133,9 @@ dependency_groups = ["test"]
131133
set_env = { PYTHONWARNDEFAULTENCODING = "1" }
132134

133135
[tool.tox.env.lint]
134-
depends = []
135-
deps = ["pre-commit"]
136+
dependency_groups = "lint"
136137
package = "skip"
137138
commands = [["pre-commit", "run", "-a"]]
138139

139140
[tool.tox.env.pkg]
140-
deps = ["build", "flit >= 3.8"]
141141
commands = [["pytest", "tests/test_sdist.py", { replace = "posargs", extend = true }]]

0 commit comments

Comments
 (0)