-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
177 lines (159 loc) · 4.8 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
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
[tool.poetry]
name = "generic-template"
version = "0.0.0"
authors = ["Kyle Finley <[email protected]>"]
description = "Generic Python project template."
license = "Apache-2.0"
[tool.poetry.dependencies]
python = "^3.11"
[tool.poetry.group.dev.dependencies]
pre-commit = "^4.0.1"
[tool.poetry.group.docs.dependencies]
furo = "^2024.8.6"
recommonmark = "^0.7.1"
sphinx = "^8.1.3"
sphinx-copybutton = "^0.5.2"
sphinx-design = "^0.6.1"
sphinxcontrib-apidoc = "^0.5.0"
sphinxcontrib-jquery = "^4.1"
[tool.poetry.group.lint.dependencies]
black = "^24.10.0"
ruff = "^0.8.1"
[tool.poetry.group.test.dependencies]
coverage = "^7.6.8"
pytest = "^8.3.4"
pytest-cov = ">=6.0.0"
pytest-mock = ">=3.14.0"
[tool.black]
force-exclude = '''
/(
\.eggs
| \.git
| \.mypy_cache
| \.tox
| \.venv
| _build
| build
| dist
)/
'''
include = '\.pyi?$'
line-length = 100
target-version = ["py311", "py312"]
[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 = 120
show-fixes = true
target-version = "py311"
[tool.ruff.lint] # https://docs.astral.sh/ruff/settings/#lint
ignore = [
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in classmethod
"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
]
ignore-init-module-imports = true
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.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 = ["tool", "tool.poetry"]
spaces_before_inline_comment = 2
trailing_comma_inline_array = true
overrides."tool.poetry".first = ["name", "version"]
overrides."tool.poetry.dependencies".first = ["python"]
[build-system]
build-backend = "poetry_dynamic_versioning.backend"
requires = ["poetry-core>=1.0.7", "poetry-dynamic-versioning>=1.2.0,<2.0.0"]