-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
358 lines (342 loc) · 9.74 KB
/
Copy pathpyproject.toml
File metadata and controls
358 lines (342 loc) · 9.74 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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
[project]
name = "saritasa-drf-tools"
dynamic = [
"version",
]
description = "Tools For DRF Used By Saritasa"
authors = [
{name = "Saritasa", email = "pypi@saritasa.com"}
]
maintainers = [
{name = "Stanislav Khlud", email = "stanislav.khlud@saritasa.com"}
]
keywords = [
"python",
"django",
"drf"
]
license = "MIT"
readme = "README.md"
classifiers = [
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Framework :: Django",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
"Framework :: Django :: 5.2",
"Framework :: Django :: 6.0",
"Framework :: Pytest",
]
requires-python = ">=3.12"
dependencies = [
# Django framework
# https://www.djangoproject.com/
"django>=4",
# Django REST Framework
# https://www.django-rest-framework.org/
"djangorestframework>=3.15",
]
[project.optional-dependencies]
filter = [
# Filter querysets dynamically
# https://django-filter.readthedocs.io/en/stable/
"django-filter>=24",
]
openapi = [
# OpenApi auto specs generator
# https://drf-spectacular.readthedocs.io/en/latest/
"drf-spectacular>=0.29",
]
all = [
"django-filter>=24",
"drf-spectacular>=0.29",
]
[dependency-groups]
local = [
"ipython",
# Exports functions to access the IPython debugger, which features tab completion, syntax highlighting, better tracebacks
# https://github.com/gotcha/ipdb
"ipdb",
# A fast Git hook manager written in Rust, designed as a drop-in alternative to pre-commit, reimagined.
# https://prek.j178.dev/
"prek",
# Collection of invoke commands which used in Saritasa organization
# https://github.com/saritasa-nest/saritasa-python-invocations/
"saritasa-invocations[env_settings]",
# A library and CLI app for rendering project templates.
# https://copier.readthedocs.io/en/latest/
"copier",
]
linters = [
# Mypy is a static type checker for Python.
# https://mypy.readthedocs.io/en/stable/
"mypy",
]
docs = [
# Project documentation with Markdown.
# https://www.mkdocs.org/
"mkdocs",
# A powerful documentation framework on top of MkDocs
# https://squidfunk.github.io/mkdocs-material/
"mkdocs-material",
# Automatic documentation from sources, for MkDocs
# https://mkdocstrings.github.io/
"mkdocstrings[python]",
# Manage multiple versions of your MkDocs-powered documentation
# https://github.com/jimporter/mike
"mike",
]
test = [
# Makes it easy to write small tests, yet scales to support complex functional testing
# https://github.com/pytest-dev/pytest/
"pytest",
# To prettify pytest output
# https://github.com/Teemu/pytest-sugar
"pytest-sugar",
# Allows you to use fixtures in @pytest.mark.parametrize.
# https://pypi.org/project/pytest-lazy-fixtures/
"pytest-lazy-fixtures",
# This plugin produces coverage reports.
# https://pytest-cov.readthedocs.io/en/latest/index.html
"pytest-cov",
# Django related stuff
# Provides useful tools for testing Django apps
# Docs https://pytest-django.readthedocs.io/en/latest/
"pytest-django",
# Provide management command to check if primary database is ready to accept
# connections
# https://github.com/painless-software/django-probes
"django-probes",
# Different useful Django utils
# https://django-extensions.readthedocs.io/en/latest/
"django-extensions",
# Standardize DRF API error responses with drf-spectacular support
# https://drf-standardized-errors.readthedocs.io/en/latest/
"drf-standardized-errors",
# Psycopg 3 is a modern implementation of a PostgreSQL adapter for Python.
# https://psycopg.org/
"psycopg[binary]",
# Fast creating of model instances. May be used in tests
# https://factoryboy.readthedocs.io/en/stable/
"factory-boy",
]
[project.urls]
Documentation = "https://saritasa-nest.github.io/saritasa-drf-tools/latest/"
Repository = "https://github.com/saritasa-nest/saritasa-drf-tools"
Changelog = "https://saritasa-nest.github.io/saritasa-drf-tools/latest/changelog/"
Releases = "https://github.com/saritasa-nest/saritasa-drf-tools/releases/"
"Bug Tracker" = "https://github.com/saritasa-nest/saritasa-drf-tools/issues/"
Contributing ="https://saritasa-nest.github.io/saritasa-drf-tools/latest/contributing/"
[project.entry-points.pytest11]
saritasa_drf_tools = "saritasa_drf_tools.pytest_plugin"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.version]
# https://regex101.com/r/b6WRcJ/1
pattern = "(?<=^## )(?P<version>(\\d{1,2}\\.\\d{1,2}\\.\\d{1,3})).*$"
path = "CHANGELOG.md"
[tool.hatch.build.targets.wheel]
packages = [
"saritasa_drf_tools"
]
[tool.ruff]
line-length = 79
indent-width = 4
[tool.ruff.lint]
extend-select = [
# https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
"W",
"E",
# https://docs.astral.sh/ruff/rules/#mccabe-c90
"C90",
# https://docs.astral.sh/ruff/rules/#isort-i
"I",
# https://docs.astral.sh/ruff/rules/#pep8-naming-n
"N",
# https://docs.astral.sh/ruff/rules/#pydocstyle-d
"D",
# https://docs.astral.sh/ruff/rules/#pyupgrade-up
"UP",
# https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"ANN",
# https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"S",
# https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"B",
# https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"A",
# https://docs.astral.sh/ruff/rules/#flake8-commas-com
"COM",
# https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
"C4",
# https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"DTZ",
# https://docs.astral.sh/ruff/rules/#flake8-debugger-t10
"T10",
# https://docs.astral.sh/ruff/rules/#flake8-print-t20
"T20",
# https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
"PT",
# https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"SIM",
# https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
"PTH",
# https://docs.astral.sh/ruff/rules/#flake8-todos-td
"TD",
# https://docs.astral.sh/ruff/rules/#eradicate-era
"ERA",
# https://docs.astral.sh/ruff/rules/#tryceratops-try
"TRY",
# https://docs.astral.sh/ruff/rules/#flynt-fly
"FLY",
# https://docs.astral.sh/ruff/rules/#perflint-perf
"PERF",
# https://docs.astral.sh/ruff/rules/#refurb-furb
"FURB",
# https://docs.astral.sh/ruff/rules/#flake8-pie-pie
"PIE",
# https://docs.astral.sh/ruff/rules/#flake8-async-async
"ASYNC",
# https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"RUF",
]
ignore = [
# https://docs.astral.sh/ruff/rules/any-type
"ANN401",
# https://docs.astral.sh/ruff/rules/missing-type-kwargs
"ANN003",
# https://docs.astral.sh/ruff/rules/undocumented-public-module
"D100",
# https://docs.astral.sh/ruff/rules/undocumented-public-package
"D104",
# https://docs.astral.sh/ruff/rules/undocumented-public-nested-class
"D106",
# https://docs.astral.sh/ruff/rules/undocumented-public-init
"D107",
# https://docs.astral.sh/ruff/rules/raise-vanilla-args
"TRY003",
# https://docs.astral.sh/ruff/rules/try-consider-else
"TRY300",
# https://docs.astral.sh/ruff/rules/mutable-class-default
"RUF012",
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
# https://docs.astral.sh/ruff/rules/unused-import
"F401",
]
"**/tests/*" = [
# https://docs.astral.sh/ruff/rules/assert
"S101",
# https://docs.astral.sh/ruff/rules/hardcoded-password-func-arg
"S106",
# https://docs.astral.sh/ruff/rules/suspicious-non-cryptographic-random-usage
"S311",
]
"**/test_*" = [
# https://docs.astral.sh/ruff/rules/missing-return-type-undocumented-public-function
"ANN201",
]
"**/migrations/*" = [
# https://docs.astral.sh/ruff/rules/undocumented-public-class
"D101",
# https://docs.astral.sh/ruff/rules/line-too-long
"E501",
]
[tool.ruff.lint.isort]
force-wrap-aliases = true
split-on-trailing-comma = true
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"local-folder",
]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
parametrize-names-type = "list"
parametrize-values-type = "list"
parametrize-values-row-type = "list"
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.mypy]
# https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
ignore_missing_imports = true
strict = false
warn_no_return = false
check_untyped_defs = true
disallow_any_generics = true
exclude = "venv|/.venv"
[[tool.mypy.overrides]]
module = "tests/*"
disable_error_code = [
"attr-defined",
"operator",
"valid-type",
"name-defined",
"misc",
]
[tool.pyright]
ignore = [
# Disabled for tests because of dynamic nature of pytest
"**/*test_*.py",
"invocations/**"
]
[tool.pytest.ini_options]
# --reuse-db
# allow saving DB tables between test sessions (like --keepdb)
# --capture=no
# allow use of ipdb during tests
# --ff
# run last failed tests first
# --verbose
# Extend pytest output
# The last configs are for coverage
addopts = [
"--reuse-db",
"--ff",
"--capture=no",
"--verbose",
"--cov-config=pyproject.toml",
"--junitxml=pytest.xml",
]
# skip all files inside following dirs
norecursedirs = [
"venv",
".venv",
]
# set Django settings
DJANGO_SETTINGS_MODULE = "example.settings"
[tool.coverage.run]
omit = [
"**/testing/plugin.py",
"**/*test_*.py",
"**/invocations/**",
"**/example/**",
"tasks.py",
]
[tool.coverage.report]
show_missing = true
skip_covered = true
skip_empty = true
exclude_also = [
"def __repr__",
"def __str__",
"raise NotImplementedError",
]
[tool.coverage.xml]
output = "coverage.xml"