-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
224 lines (206 loc) · 4.94 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
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "django-spaday"
description = "A Django package that provides 'out-of-the-box' JWT auth, user, group, and permission APIs for use in Single Page Apps (eg - Vue, React)."
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"django>=4.0,<5.0",
"drf-spectacular",
"django-auditlog",
"django-celery-results",
"django-filter",
"django-perm-filter",
]
dynamic = ["version", "readme"]
requires-python = ">=3.9"
authors = [{ name = "Tim Santor", email = "tsantor@xstudios.com" }]
[project.urls]
# Homepage = "https://example.com"
# Documentation = "https://readthedocs.org"
Repository = "https://github.com/tsantor/django-spaday.git"
Issues = "https://github.com/tsantor/django-spaday/issues"
Changelog = "https://github.com/tsantor/django-spaday/blob/master/HISTORY.md"
[project.optional-dependencies]
dev = []
[tool.setuptools.packages.find]
# https://setuptools.pypa.io/en/latest/userguide/datafiles.html
where = ["src"]
[tool.setuptools.dynamic]
version = { attr = "django_spaday.__version__" }
readme = { file = ["README.md", "HISTORY.md"], content-type = "text/markdown" }
# ==== pytest ====
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--ds=django_project.settings --reuse-db"
python_files = ["tests.py", "test_*.py"]
norecursedirs = ["node_modules"]
filterwarnings = "ignore::DeprecationWarning"
pythonpath = "src"
# ==== Coverage ====
[tool.coverage.run]
include = ["*/django_spaday/**/*.py"]
omit = ["*/migrations/*", "*/tests/*"]
plugins = ["django_coverage_plugin"]
# ==== mypy ====
[tool.mypy]
python_version = "3.11"
check_untyped_defs = true
ignore_missing_imports = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_unused_configs = true
plugins = ["mypy_django_plugin.main", "mypy_drf_plugin.main"]
[[tool.mypy.overrides]]
# Django migrations should not produce any errors:
module = "*.migrations.*"
ignore_errors = true
[tool.django-stubs]
django_settings_module = "django_project.settings"
# ==== djLint ====
[tool.djlint]
blank_line_after_tag = "load,extends"
close_void_tags = true
format_css = true
format_js = true
# TODO: remove T002 when fixed https://github.com/Riverside-Healthcare/djLint/issues/687
ignore = "H006,H030,H031,T002"
include = "H017,H035"
indent = 2
max_line_length = 119
profile = "django"
[tool.djlint.css]
indent_size = 2
[tool.djlint.js]
indent_size = 2
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"*/migrations/*.py",
"staticfiles/*",
]
# Same as Django: https://github.com/cookiecutter/cookiecutter-django/issues/4792.
line-length = 88
indent-width = 4
target-version = "py311"
[tool.ruff.lint]
select = [
"F",
"E",
"W",
"C90",
"I",
"N",
"UP",
"YTT",
# "ANN", # flake8-annotations: we should support this in the future but 100+ errors atm
"ASYNC",
"S",
"BLE",
"FBT",
"B",
"A",
"COM",
"C4",
"DTZ",
"T10",
"DJ",
"EM",
"EXE",
"FA",
'ISC',
"ICN",
"G",
'INP',
'PIE',
"T20",
'PYI',
'PT',
"Q",
"RSE",
"RET",
"SLF",
"SLOT",
"SIM",
"TID",
"TCH",
"INT",
# "ARG", # Unused function argument
"PTH",
"ERA",
"PD",
"PGH",
"PL",
"TRY",
"FLY",
# "NPY",
# "AIR",
"PERF",
# "FURB",
# "LOG",
"RUF",
]
ignore = [
"S101", # Use of assert detected https://docs.astral.sh/ruff/rules/assert/
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"SIM102", # sometimes it's better to nest
"ERA001",
"PGH004",
"E501",
]
# Project specifc ignore
extend-ignore = [
"S106", # hardcoded password in tests
"RUF005", # iterable unpacking instead of concatenation
"S104", # Possible binding to all interfaces,
"S311", # We're not using it for cryptography
"FBT001", # Boolean typed positional argument
"FBT002", # Boolean default positional argument
"S308", # mark_safe is ok here
# "SLF001" # accessing private _meta is ok here
"TRY300", # Consider moving this statement to an `else` block
"COM812", # Recommended from ruff
"ISC001", # Recommended from ruff
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.ruff.lint.isort]
force-single-line = true