-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
132 lines (111 loc) · 3.54 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
[build-system]
requires = ["hatchling>=1.21.0", "hatch-vcs>=0.3.0"]
build-backend = "hatchling.build"
[project]
name = "wizard-template"
description = "A template for a python project containing a package, tests, docs, and CI/CD."
readme = "README.md"
license = "MIT"
requires-python = ">=3.9"
authors = [{ name = "fschuch", email = "[email protected]" }]
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3",
"Programming Language :: Python",
]
dynamic = ["version"]
dependencies = []
[project.urls]
Source = "https://github.com/fschuch/wizard-template"
Tracker = "https://github.com/fschuch/wizard-template/issues"
Changelog = "https://github.com/fschuch/wizard-template/blob/main/CHANGELOG.md"
Documentation = "https://fschuch.github.io/wizard-template/"
[project.scripts]
[tool.pytest.ini_options]
addopts = [
"--doctest-modules",
"--doctest-continue-on-failure",
"--doctest-report=ndiff",
]
minversion = "8.0"
[tool.coverage.run]
branch = true
relative_files = true
source = ["src/wizard_template", "tests"]
omit = ["src/wizard_template/_version.py"]
[tool.coverage.report]
fail_under = 90
precision = 2
show_missing = true
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
[tool.ruff]
extend-exclude = ["./docs/conf.py"]
[tool.ruff.lint.extend-per-file-ignores]
"__init__.py" = ["F401"] # imported but unused
"*.ipynb" = ["E402"] # module level import not at top of file
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.mypy]
pretty = true
ignore_missing_imports = true
exclude = ["docs/conf.py"]
[tool.codespell]
skip = "docs/conf.py"
check-filenames = true
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "src/wizard_template/_version.py"
[tool.hatch.envs.default]
description = "Base development environment"
installer = "uv"
dependencies = [
"coverage[toml]>=7.5.3",
"pre-commit>=3.5.0",
"pytest-cov>=5.0.0",
"pytest>=8.2.2",
]
[tool.hatch.envs.default.scripts]
_wizard = ["python ./tools/rename_project_content.py"]
pre-commit-install = "pre-commit install {args}"
pre-commit-uninstall = "pre-commit uninstall {args}"
check = "pre-commit run {args} --all-files"
type = "check mypy {args}"
lint = "check ruff {args}"
format = "check ruff-format {args}"
test = "pytest --cov --cov-report=term {args}"
test-no-cov = "test --no-cov {args}"
qa = ["check", "test", "echo '✅ QA passed'"]
[tool.hatch.envs.test]
description = "Extended test environment"
extra-dependencies = ["pytest-randomly", "pytest-rerunfailures", "pytest-xdist"]
[tool.hatch.envs.test.scripts]
extended = "test -n auto --reruns 7 --reruns-delay 1 {args}"
[[tool.hatch.envs.test.matrix]]
python = ["3.9", "3.10", "3.11", "3.12", "3.13"]
[tool.hatch.envs.docs]
description = "Documentation environment"
template = "docs"
install = true
installer = "uv"
python = "3.12"
dependencies = [
"docutils==0.20.1",
"jupyter-book==1.0.0",
"sphinx-autobuild==2024.4.16",
"sphinx==7.3.7",
]
[tool.hatch.envs.docs.scripts]
config = "jupyter-book config sphinx docs {args}"
build = ["config", "jupyter-book build docs --path-output build {args}"]
serve = [
"config",
"sphinx-autobuild docs build/_build/html --open-browser --watch src/wizard_template {args}",
]