-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
279 lines (253 loc) · 6.7 KB
/
pyproject.toml
File metadata and controls
279 lines (253 loc) · 6.7 KB
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
[build-system]
requires = ["hatchling>=1.24", "hatch-vcs>=0.4"]
build-backend = "hatchling.build"
[project]
name = "package_name"
description = "A short description of your package"
readme = {file = "README.md", content-type = "text/markdown"}
requires-python = ">=3.12"
dynamic = ["version"]
authors = [
{name = "Your Name", email = "your.email@example.com"},
]
license = {file = "LICENSE"}
keywords = ["keyword1", "keyword2"]
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries",
]
dependencies = [
"doit>=0.36.0",
"rich>=13.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8.0",
"pytest-cov>=5.0",
"pytest-xdist>=3.5",
"ruff>=0.5",
"mypy>=1.0",
"pre-commit>=3.7.0",
"mkdocs-material>=9.5",
"mkdocstrings[python]>=0.24",
"codespell>=2.2",
"pyproject-fmt>=2.0",
"commitizen>=3.0",
"pyright>=1.1.0",
"pyyaml>=6.0",
"types-pyyaml>=6.0",
"vulture>=2.11",
"radon>=6.0",
"pytest-benchmark>=4.0",
"mutmut>=3.0",
"hypothesis>=6.0",
]
security = [
"pip-audit>=2.6",
"bandit>=1.7",
"pip>=26.0",
"pip-licenses>=4.0",
"cyclonedx-bom>=4.0",
]
[project.urls]
Homepage = "https://github.com/username/package_name"
Repository = "https://github.com/username/package_name"
Documentation = "https://github.com/username/package_name/tree/main/docs"
Issues = "https://github.com/username/package_name/issues"
[project.scripts]
[tool.hatch.build.targets.wheel]
packages = ["src/package_name"]
[tool.hatch.version]
source = "vcs"
tag-pattern = "^(?:v|d)(?P<version>.+)$"
fallback-version = "0.0.0"
[tool.hatch.build.hooks.vcs]
version-file = "src/package_name/_version.py"
[tool.ruff]
line-length = 100
target-version = "py312"
extend-exclude = ["**/_version.py"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"W", # pycodestyle warnings
"UP", # pyupgrade
"ANN", # flake8-annotations (type hints)
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"RUF", # Ruff-specific rules
"SIM", # flake8-simplify
"ASYNC", # flake8-async
]
ignore = []
[tool.ruff.lint.per-file-ignores]
"tools/pyproject_template/*.py" = [
"ANN401", # Any return type for dynamic GitHub API responses
"RUF022", # __all__ intentionally grouped by category, not sorted
]
"tests/benchmarks/*.py" = [
"ANN401", # benchmark fixture has no py.typed
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "lf"
[tool.mypy]
python_version = "3.12"
disallow_untyped_defs = true
warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true
check_untyped_defs = true
disallow_any_generics = false
disallow_incomplete_defs = true
disallow_subclassing_any = true
no_implicit_optional = true
strict_equality = true
warn_redundant_casts = true
warn_unreachable = true
# tools/pyproject_template/ uses sys.path manipulation for standalone execution
exclude = ["tools/pyproject_template/", ".claude/", ".gemini/", ".codex/"]
[[tool.mypy.overrides]]
module = "doit.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
# Standalone scripts using sys.path manipulation; excluded from discovery
# but still followed via imports from bootstrap.py
module = "tools.pyproject_template.*"
follow_imports = "skip"
[tool.pytest.ini_options]
minversion = "8.0"
addopts = "--strict-config --strict-markers --benchmark-disable"
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"benchmark: marks tests as performance benchmarks (deselect with '--benchmark-disable')",
"property: marks tests as property-based tests (run with Hypothesis)",
]
[tool.pytest-benchmark]
disable_gc = true
min_rounds = 5
warmup = true
[tool.coverage.run]
branch = true
source = ["package_name"]
[tool.coverage.report]
skip_covered = false
show_missing = true
precision = 2
fail_under = 80
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"raise NotImplementedError",
"if __name__ == .__main__.:",
]
[tool.coverage.html]
directory = "tmp/htmlcov"
[tool.coverage.xml]
output = "tmp/coverage.xml"
[tool.bandit]
exclude_dirs = [
"tests",
"tmp",
".venv",
"docs",
"examples",
".git",
".github",
".pytest_cache",
".mypy_cache",
".ruff_cache",
"site",
".claude",
".gemini",
".codex",
".devcontainer",
".vscode",
]
skips = [
"B101",
"B603",
"B607",
]
[tool.codespell]
skip = "tmp,.venv,.git,*.lock,*.pyc,__pycache__"
ignore-words-list = "crate"
[tool.vulture]
min_confidence = 80
paths = ["src", "tests"]
exclude = [
"*/tests/*", # Test fixtures often appear unused
"*/__pycache__/*",
]
# Common false positives in Python projects
ignore_names = [
"test_*", # Pytest test functions
"fixture_*", # Pytest fixtures
"*_fixture", # Pytest fixtures
"setUp", # unittest methods
"tearDown", # unittest methods
"setUpClass", # unittest methods
"tearDownClass", # unittest methods
]
ignore_decorators = [
"@pytest.fixture",
"@pytest.mark.*",
"@click.command",
"@click.option",
"@click.group",
"@abstractmethod",
]
[tool.mutmut]
paths_to_mutate = "src/"
tests_dir = "tests/"
runner = "uv run python -m pytest -x --assert=plain"
[tool.commitizen]
name = "cz_conventional_commits"
version = "0.0.0"
tag_format = "v$version"
version_provider = "scm"
update_changelog_on_bump = true
major_version_zero = true
merge_prerelease = true
bump_pattern = "^(feat|fix|refactor|perf)"
bump_map = { "feat" = "MINOR", "fix" = "PATCH", "refactor" = "PATCH", "perf" = "PATCH" }
change_type_order = ["BREAKING CHANGE", "feat", "fix", "refactor", "perf"]
[tool.pyright]
# LSP support for Claude Code - provides fast code navigation and type checking
include = [
"src",
"tests",
"*.py", # Root level Python files (dodo.py, setup-repo.py, configure.py)
"tools", # Tools directory (migrate_existing_project.py)
".github", # Any Python in GitHub workflows/scripts
]
exclude = [
"**/__pycache__",
"**/.venv",
"**/tmp",
"**/.pytest_cache",
"**/.mypy_cache",
"**/.ruff_cache",
"**/site", # mkdocs build output
"**/.git",
]
venvPath = "."
venv = ".venv"
pythonVersion = "3.12"
typeCheckingMode = "basic"
useLibraryCodeForTypes = true
reportMissingImports = true
reportMissingTypeStubs = false