Skip to content

Commit db53190

Browse files
committed
test: fix tox and toml-sort
1 parent c2e89d0 commit db53190

File tree

4 files changed

+36
-35
lines changed

4 files changed

+36
-35
lines changed

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Answer file maintained by Copier for: https://github.com/KyleKing/mdformat-plugin-template
33
# DO NOT MODIFY THIS FILE. Edit by re-running copier and changing responses to the questions
44
# Check into version control.
5-
_commit: 1.1.1
5+
_commit: 1.1.2
66
_src_path: gh:KyleKing/mdformat-plugin-template
77
author_email: [email protected]
88
author_name: Kyle King

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ repos:
2626
- id: trailing-whitespace
2727
exclude: __snapshots__/.*\.ambr
2828
- repo: https://github.com/executablebooks/mdformat
29-
rev: 0.7.18
29+
rev: 0.7.19
3030
hooks:
3131
- id: mdformat
3232
additional_dependencies:
@@ -41,7 +41,7 @@ repos:
4141
- id: yamllint
4242
stages: ["pre-commit"]
4343
- repo: https://github.com/pappasam/toml-sort
44-
rev: v0.23.1
44+
rev: v0.24.2
4545
hooks:
4646
- id: toml-sort-fix
4747
stages: ["pre-commit"]

pyproject.toml

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ requires-python = ">=3.9.0"
2525
[project.entry-points."mdformat.parser_extension"]
2626
admon = "mdformat_admon"
2727

28-
[project.optional-dependencies]
29-
test = [
30-
"pytest >= 8.3.4",
31-
"pytest-beartype >= 0.1.1",
32-
"pytest-cov >= 6.0.0",
33-
]
34-
3528
[project.urls]
3629
"Bug Tracker" = "https://github.com/kyleking/mdformat-admon/issues"
3730
"Changelog" = "https://github.com/kyleking/mdformat-admon/releases"
@@ -134,44 +127,49 @@ all = true
134127
in_place = true
135128
trailing_comma_inline_array = true
136129

130+
[tool.tomlsort.overrides."tool.tox.env.*"]
131+
inline_arrays = false
132+
137133
[tool.tox]
134+
basepython = ["python3.12", "python3.9"]
138135
# Docs: https://tox.wiki/en/4.23.2/config.html#core
139-
envlist = [
140-
"py312-beartype",
141-
"py312-mypy",
142-
"py312-pre-commit",
143-
"py312-ruff",
144-
"py39-cov",
145-
"py39-hook",
146-
]
136+
env_list = ["py12-test", "py312-pre-commit", "py312-ruff", "py312-type", "py39-hook", "py39-test"]
147137
isolated_build = true
148138
requires = ["tox>=4.20.0"]
149139
skip_missing_interpreters = false
150140

151-
[tool.tox."py312-beartype"]
152-
commands = ["pytest posargs --ff --nf -vv --exitfirst --beartype-packages='mdformat_admon'"]
153-
extras = "test"
154-
155-
[tool.tox."py312-mypy"]
156-
commands = ["mypy ./mdformat_admon"]
157-
deps = "mypy>=1.13.0"
141+
[tool.tox.env."py12-test"]
142+
commands = [["pytest", "--cov=mdformat_admon", {default = [], extend = true, replace = "posargs"}]]
143+
deps = ["--requirement=tests/requirements.txt"]
144+
description = "Optionally, specify: '--exitfirst --failed-first --new-first -vv --beartype-packages=mdformat_admon'"
158145

159-
[tool.tox."py312-pre-commit"]
160-
commands = ["pre-commit run posargs:--all-files"]
146+
[tool.tox.env."py312-pre-commit"]
147+
commands = [["pre-commit", "run", "--all-files", {default = [], extend = true, replace = "posargs"}]]
161148
deps = "pre-commit>=4.0.1"
149+
skip_install = true
162150

163-
[tool.tox."py312-ruff"]
151+
[tool.tox.env."py312-ruff"]
164152
commands = [
165-
"ruff check . --fix --unsafe-fixes",
166-
"ruff format .",
153+
["ruff", "check", ".", "--fix", {default = [], extend = true, replace = "posargs"}],
154+
["ruff", "format", "."],
167155
]
168156
deps = "ruff>=0.8.3"
157+
description = "Optionally, specify: '--unsafe-fixes'"
169158
skip_install = true
170159

171-
[tool.tox."py39-cov"]
172-
commands = ["pytest --cov=mdformat_admon posargs"]
173-
extras = "test"
160+
[tool.tox.env."py312-type"]
161+
commands = [["mypy", "./mdformat_admon", {default = [], extend = true, replace = "posargs"}]]
162+
deps = ["mypy>=1.13.0"]
174163

175-
[tool.tox."py39-hook"]
176-
commands = ["pre-commit run --config .pre-commit-test.yaml posargs:--all-files --verbose --show-diff-on-failure"]
164+
[tool.tox.env."py39-hook"]
165+
commands = [["pre-commit", "run", "--config=.pre-commit-test.yaml", "--all-files", {default = ["--show-diff-on-failure", "--verbose"], extend = true, replace = "posargs"}]]
177166
deps = "pre-commit>=4.0.1"
167+
skip_install = true
168+
169+
[tool.tox.env."py39-test"]
170+
commands = [["pytest", "--cov=mdformat_admon"]]
171+
deps = ["--requirement=tests/requirements.txt"]
172+
173+
[tool.tox.env_run_base]
174+
# Validates that commands are set
175+
commands = [["error-commands-are-not-set"]]

tests/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pytest >= 8.3.4
2+
pytest-beartype >= 0.1.1
3+
pytest-cov >= 6.0.0

0 commit comments

Comments
 (0)