-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
266 lines (238 loc) · 6.22 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
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
[build-system]
build-backend = "flit_core.buildapi"
requires = ["flit_core>=3.2,<4"]
[project]
authors = [{ name = "klove" }]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Framework :: Django :: 4.2",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"django-rest-framework>=0.1.0",
"django<6,>=4.2",
"flit<4,>=3.2",
]
description = "Mixins to make class-based generic views simpler and neater."
license = { file = "LICENSE.txt" }
name = "django-brackets"
readme = "README.md"
requires-python = ">=3.10"
version = "2024"
[project.optional-dependencies]
development = [
"django-stubs[compatible-mypy]",
"djangorestframework-stubs[compatible-mypy]",
"interrogate",
"mypy",
"ruff",
]
documentation = [
"mkdocs-material>=9.1.16",
"mkdocs>=1.4.3",
"pygments>=2.15.1",
"pymdown-extensions>=10.0.1",
]
testing = [
"coverage",
"pytest",
"pytest-cov",
"pytest-django",
"pytest-lazy-fixture",
"pytest-randomly",
"pytest-xdist",
"tox",
]
[project.urls]
repository = "https://github.com/brack3t/django-brackets/"
[tool.coverage.report]
exclude_lines = [
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
"pragma: no cover",
"raise NotImplementedError",
]
fail_under = 95
ignore_errors = true
omit = [
"build/*",
"conftest.py",
"dist/*",
"docs/*",
"setup.py",
"tests/*",
"venv/*",
]
show_missing = true
[tool.coverage.run]
branch = true
source = ["brackets"]
[tool.coverage.xml]
output = ".coverage.xml"
[tool.django-stubs]
django_settings_module = "tests.project.settings"
[tool.flit.module]
name = "brackets"
[tool.interrogate]
color = true
exclude = ["build", "conftest.py", "docs", "setup.py"]
fail-under = 75
ignore-init-method = true
ignore-init-module = false
ignore-magic = false
ignore-module = true
ignore-nested-classes = true
ignore-nested-functions = false
ignore-private = false
ignore-property-decorators = false
ignore-regex = ["^get$", "^mock_.*"]
ignore-semiprivate = false
omit-covered-files = true
quiet = false
verbose = 1
[tool.mypy]
allow_redefinition = false
check_untyped_defs = true
color_output = true
disallow_untyped_calls = false
disallow_untyped_decorators = false
disallow_untyped_defs = false
error_summary = true
exclude = [".venv", "build", "dist", "docs", "tests/*"]
ignore_errors = false
ignore_missing_imports = true
implicit_reexport = false
local_partial_types = true
no_implicit_optional = true
plugins = ["mypy_django_plugin.main", "mypy_drf_plugin.main"]
pretty = true
show_column_numbers = true
show_error_context = true
strict = true
strict_equality = true
strict_optional = true
warn_no_return = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[tool.pyright]
exclude = ["build", "dist", "docs", "tests"]
ignore = ["tests"]
include = ["src"]
pythonVerion = "3.11"
reportMissingImports = "information"
reportMissingTypeStubs = "information"
reportUnknownMemberType = "information"
root = ["src"]
strict = ["src"]
typeCheckingMode = "strict"
useLibraryCodeForTypes = true
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "tests.project.settings"
django_find_project = false
markers = ["mixin", "mixin_view_factory"]
norecursedirs = [".devcontainer", ".git", ".mypy_cache", "__pycache__", "docs"]
pythonpath = [".", "src", "tests.project"]
testpaths = ["tests"]
[tool.ruff]
select = [
"ANN", # flake8-annotations
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"COM", # flake8-commas
"D", # pydocstyle
"DJ", # flake8-django
"E", # pycodestyle
"EM", # flake8-errmsg
"ERA", # flake8-eradicate
"F", # Pyflakes
"FBT", # flake8-boolean-trap
"G", # flake8-logging-format
"I", # isort
"INP", # flake8-no-pep420
"N", # pep8-naming
"PIE", # flake8-pie
"PT", # flake8-pytest
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raises
"RUF", # ruff-specific rules
"S", # flake8-bandit
"SIM", # flake8-simplify
"T20", # flake8-print
"TCH", # flake8-type-checking
"TRY", # tryceratops
]
# ignore
ignore = ["ANN101", "COM812", "D203", "D211", "D213", "F403"]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
extend-exclude = ["docs"]
ignore-init-module-imports = true
src = ["src", "tests"]
# Assume Python 3.11.
target-version = "py311"
indent-width = 4
line-length = 88
output-format = "pylint"
[tool.ruff.format]
indent-style = "space"
line-ending = "auto"
quote-style = "double"
skip-magic-trailing-comma = false
[tool.ruff.per-file-ignores]
"src/brackets/*.pyi" = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
]
"tests/mixins/test_*.py" = [
"ANN001", # Missing type annotation for function argument
"ANN002", # Missing type annotation for *args
"ANN003", # Missing type annotation for **kwargs
"ANN201", # Missing return type annotation for public function
"ANN202", # Missing return type annotation for private function
"FBT001", # Positional Boolean
"S101", # assert used
]
[tool.ruff.isort]
combine-as-imports = true
known-third-party = ["django", "rest_framework"]
split-on-trailing-comma = true
[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.tbump]
github_url = "https://github.com/brack3t/django-brackets/"
[tool.tbump.version]
current = "2023"
# Example of a semver regexp.
# Make sure this matches current_version before
# using tbump
regex = '''
(?P<year>\d{4})
(?:\.)(?P<month>\d{2})?
'''
[tool.tbump.git]
message_template = "Bump to {new_version}"
tag_template = "{new_version}"
# For each file to patch, add a [[tool.tbump.file]] config
# section containing the path of the file, relative to the
# tbump.toml location.
[[tool.tbump.file]]
src = "brackets/__init__.py"
[[tool.tbump.before_commit]]
cmd = "grep -q {new_version} docs/changelog.md"
name = "check changelog"