Skip to content

Commit 6920303

Browse files
committed
ci(tox): add test:all command to run the test suite on all support Python versions using tox
1 parent 7663adc commit 6920303

File tree

2 files changed

+131
-14
lines changed

2 files changed

+131
-14
lines changed

poetry.lock

+116-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+15
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ packages = [{ include = "commitizen" }, { include = "commitizen/py.typed" }]
104104

105105
[tool.poetry.group.dev.dependencies]
106106
ipython = "^8.0"
107+
tox = ">4"
107108

108109
[tool.poetry.group.test.dependencies]
109110
pytest = ">=7.2,<9.0"
@@ -168,6 +169,17 @@ testpaths = [
168169
"tests/",
169170
]
170171

172+
[tool.tox]
173+
requires = ["tox>=4.22"]
174+
env_list = ["3.9", "3.10", "3.11", "3.12", "3.13"]
175+
176+
[tool.tox.env_run_base]
177+
description = "Run tests suite against Python {base_python}"
178+
skip_install = true
179+
deps = ["poetry>=2.0"]
180+
commands_pre = [["poetry", "install", "--only", "main,test"]]
181+
commands = [["pytest", { replace = "posargs", extend = true}]]
182+
171183
[tool.ruff]
172184
line-length = 88
173185

@@ -228,6 +240,9 @@ lint.sequence = [
228240
test.help = "Run the test suite"
229241
test.cmd = "pytest -n 3 --dist=loadfile"
230242

243+
"test:all".help = "Run the test suite on all supported Python versions"
244+
"test:all".cmd = "tox --parallel"
245+
231246
cover.help = "Run the test suite with coverage"
232247
cover.ref = "test --cov-report term-missing --cov-report=xml:coverage.xml --cov=commitizen"
233248

0 commit comments

Comments
 (0)