@@ -9,19 +9,22 @@ requires-python = ">=3.10"
99
1010[project .optional-dependencies ]
1111dev = [
12+ " basedpyright>=1.27.1" ,
1213 " copier" ,
14+ " hatch>=1.14.0" ,
1315 " myst-parser" ,
1416 " pre-commit" ,
1517 " pydata-sphinx-theme>=0.12" ,
16- " pytest" ,
18+ " pytest>=8.3.4 " ,
1719 " ruff" ,
1820 " sphinx-autobuild" ,
1921 " sphinx-copybutton" ,
2022 " sphinx-design" ,
21- " tox" ,
22- " tox-direct" ,
2323]
2424
25+ [tool .uv ]
26+ default-groups = []
27+
2528[tool .setuptools_scm ]
2629
2730[tool .pytest .ini_options ]
@@ -32,27 +35,33 @@ addopts = """
3235# Doctest python code in docs, python code in src docstrings, test functions in tests
3336testpaths = " tests"
3437
35- # tox must currently be configured via an embedded ini string
36- # See: https://github.com/tox-dev/tox/issues/999
37- [tool .tox ]
38- legacy_tox_ini = """
39- [tox]
40- skipsdist=True
38+ [tool .hatch .envs .default .scripts ]
39+ all = [
40+ " hatch run precommit:precommit" ,
41+ " hatch run type-check:type-check" ,
42+ " hatch run tests:tests" ,
43+ " hatch run docs:docs"
44+ ]
45+ precommit = [" hatch run precommit:precommit" ]
46+ type-check = [" hatch run type-check:type-check" ]
47+ tests = [" hatch run tests:tests" ]
48+ docs = [" hatch run docs:docs" ]
49+
50+ [tool .hatch .envs .precommit ]
51+ description = " Run pre-commit"
52+ scripts = { precommit = [" pre-commit run --show-diff-on-failure {args}" ] }
53+
54+ [tool .hatch .envs .type-check ]
55+ description = " Run type-checking"
56+ scripts = { type-check = [" basedpyright --stats src {args}" ] }
57+
58+ [tool .hatch .envs .tests ]
59+ description = " Run tests"
60+ scripts = { tests = [" pytest {args}" ] }
4161
42- [testenv:{pre-commit,tests,docs}]
43- # Don't create a virtualenv for the command, requires tox-direct plugin
44- direct = True
45- passenv = *
46- allowlist_externals =
47- pre-commit
48- pytest
49- sphinx-build
50- sphinx-autobuild
51- commands =
52- pre-commit: pre-commit run --all-files --show-diff-on-failure {posargs}
53- tests: pytest {posargs}
54- docs: sphinx-{posargs:build -EW --keep-going} -T docs build/html
55- """
62+ [tool .hatch .envs .docs ]
63+ description = " Run docs"
64+ scripts = { docs = [" sphinx-{args:build} -EW --keep-going -T docs build/html" ] }
5665
5766[tool .ruff ]
5867src = [" src" , " tests" ]
0 commit comments