-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
167 lines (147 loc) · 4.75 KB
/
pyproject.toml
File metadata and controls
167 lines (147 loc) · 4.75 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
[project]
name = "generic-template"
authors = [
{email = "kyle@finley.sh", name = "Kyle Finley"},
]
description = "Generic Python project template."
dynamic = ["version"]
license = {text = "Apache-2.0"}
requires-python = ">=3.11, <4"
[tool.poetry]
version = "0.0.0"
[tool.poetry.group.dev.dependencies]
pre-commit = "^4.6.0"
[tool.poetry.group.docs.dependencies]
furo = "^2025.12.19"
recommonmark = "^0.7.1"
sphinx = "^8.2.3"
sphinx-copybutton = "^0.5.2"
sphinx-design = "^0.7.0"
sphinxcontrib-apidoc = "^0.6.0"
sphinxcontrib-jquery = "^4.1"
[tool.poetry.group.lint.dependencies]
ruff = "^0.15.11"
[tool.poetry.group.test.dependencies]
coverage = "^7.13.5"
pytest = "^9.0.3"
pytest-cov = ">=7.1.0"
pytest-mock = ">=3.15.1"
[tool.poetry.requires-plugins]
poetry-dynamic-versioning = {extras = ["plugin"], version = ">=1.6.0,<2.0.0"}
[tool.coverage.report]
exclude_lines = [
"@overload",
"cov: ignore", # standard exclude comment
"if TYPE_CHECKING:", # excluded blocks
"if __name__ == .__main__.:",
"raise AssertionError", # defensive exceptions
"raise NotImplementedError",
]
# fail_under = 90 # set a minimum coverage percentage
precision = 2
show_missing = true
[tool.coverage.run]
omit = [
"*/type_defs.py", # assuming this would not contain any logic
]
[tool.poetry-dynamic-versioning]
# Docs: https://github.com/mtkennerly/poetry-dynamic-versioning
# Install: poetry self add "poetry-dynamic-versioning[plugin]@latest"
bump = true
enable = true
fix-shallow-repository = true
metadata = false
strict = true
style = "pep440"
[tool.pyright]
exclude = [
"**/.eggs",
"**/.git",
"**/.venv",
"**/__pycache__",
"**/docs",
"**/node_modules",
"**/typings",
]
pythonVersion = "3.11"
reportDuplicateImport = "none"
reportImportCycles = "none"
reportIncompatibleMethodOverride = "warning"
reportMissingTypeStubs = "none"
reportPrivateUsage = "none"
reportUnknownMemberType = "none"
reportUnnecessaryIsInstance = "warning"
reportUnusedImport = "none"
reportUnusedVariable = "none"
reportWildcardImportFromLibrary = "none"
strictParameterNoneValue = false
typeCheckingMode = "strict"
useLibraryCodeForTypes = true
venv = ".venv"
[tool.pytest.ini_options]
addopts = [
"--cov-config=pyproject.toml",
"--no-cov-on-fail",
]
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::pytest_mock.PytestMockWarning",
]
markers = [
"wip: isolate tests currently being worked on.",
]
minversion = 6.2
python_classes = ["Test*"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
testpaths = ["tests"]
[tool.ruff] # https://docs.astral.sh/ruff/settings/#top-level
force-exclude = true
line-length = 100
show-fixes = true
target-version = "py311"
[tool.ruff.format] # https://docs.astral.sh/ruff/settings/#format
docstring-code-format = true
[tool.ruff.lint] # https://docs.astral.sh/ruff/settings/#lint
ignore = [
"COM812", # Trailing comma missing
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D215", # Section underline is over-indented
"D403", # First word of the first line should be capitalized
"D406", # Section name should end with a newline
"D407", # Missing dashed underline after section
"D408", # Section underline should be in the line following the section's name
"D409", # Section underline should match the length of its name
"FIX002", # Line contains TODO
"TD003", # Missing issue link on the line following this TODO
"TID252", # Relative imports from parent modules are banned
]
select = ["ALL"]
[tool.ruff.lint.extend-per-file-ignores] # https://docs.astral.sh/ruff/settings/#lintextend-per-file-ignores
"*.py" = [
"PYI024", # Use `typing.NamedTuple` instead of `collections.namedtuple` - should only apply to pyi
]
"tests/*" = [
"FBT001", # Boolean positional arg in function definition - this is fine here
"FBT003", # Boolean positional value in function call - this is fine here
"S101", # Use of `assert` detected - this is fine here
"S108", # Probable insecure usage of temporary file or directory
"SLF001", # Private member accessed - fine in tests
]
[tool.ruff.lint.pycodestyle] # https://docs.astral.sh/ruff/settings/#lint_pycodestyle_max-line-length
max-line-length = 140
[tool.ruff.lint.pydocstyle] # https://docs.astral.sh/ruff/settings/#lintpydocstyle
convention = "google"
[tool.ruff.lint.pylint] # https://docs.astral.sh/ruff/settings/#lintpylint
allow-magic-value-types = ["bytes", "int", "str"]
[tool.tomlsort]
all = true
in_place = true
sort_first = ["project", "tool", "tool.poetry"]
spaces_before_inline_comment = 2
trailing_comma_inline_array = true
overrides.project.first = ["name", "version"]
[build-system]
build-backend = "poetry_dynamic_versioning.backend"
requires = ["poetry-core", "poetry-dynamic-versioning>=1.6.0,<2.0.0"]