Skip to content

Commit

Permalink
chore: elevate hatch environment setups and description
Browse files Browse the repository at this point in the history
There is now a setup for matrix test runs across Python versions.

All environments now also come with self descriptions that are shown
with `hatch env show`.

Environments that do not need an installed package for their function
now no longer do that.
  • Loading branch information
mih committed Sep 21, 2024
1 parent 14df621 commit a7a9fa1
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,19 @@ extra-dependencies = [
"pytest-cov",
]


[tool.hatch.envs.tests]
description = "run tests across Python versions"
template = "hatch-test"

[[tool.hatch.envs.tests.matrix]]
python = ["3.9", "3.10", "3.11", "3.12"]

[tool.hatch.envs.tests.scripts]
run = 'python -m pytest'

[tool.hatch.envs.types]
description = "type checking with MyPy"
extra-dependencies = [
"mypy>=1.0.0",
"pytest",
Expand All @@ -71,6 +83,7 @@ check = [
]

[tool.hatch.envs.docs]
description = "build Sphinx-based docs"
extra-dependencies = [
"sphinx",
]
Expand All @@ -84,11 +97,13 @@ clean = [
]

[tool.hatch.envs.cz]
description = "commit compliance, changelog, and release generation"
detached = true
extra-dependencies = [
"commitizen",
]
[tool.hatch.envs.cz.scripts]
check = [
check-commits = [
# check all commit messages since the (before) beginning
"cz check --rev-range 4b825dc642cb6eb9a060e54bf8d69288fbee4904..HEAD",
]
Expand All @@ -102,6 +117,8 @@ bump-version = [
]

[tool.hatch.envs.codespell]
description = "spell checking"
detached = true
extra-dependencies = [
"codespell",
]
Expand Down

0 comments on commit a7a9fa1

Please sign in to comment.