forked from osl-incubator/growth-forge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
302 lines (274 loc) · 7.67 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
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
[tool.poetry]
name = "growth-forge"
version = "0.1.0" # semantic-release
description = "The main objective of this platform is to offer a space to handle and organize feedback between two people"
authors = ["Ivan Ogasawara <[email protected]>"]
license = "BSD 3 Clause"
exclude = [
".git/*",
".env*",
]
include = ["src/growth_forge/py.typed"]
[tool.poetry.dependencies]
python = ">=3.10,<4"
python-slugify = ">=8.0.4" # https://github.com/un33k/python-slugify
Pillow = ">=10.2.0" # https://github.com/python-pillow/Pillow
rcssmin = ">=1.1.1" # https://github.com/ndparker/rcssmin
argon2-cffi = ">=23.1.0" # https://github.com/hynek/argon2_cffi
whitenoise = ">=6.6.0" # https://github.com/evansd/whitenoise
redis = ">=5.0.1" # https://github.com/redis/redis-py
hiredis = ">=2.3.2" # https://github.com/redis/hiredis-py
uvicorn = {version = ">=0.27.1", extras = ["standard"] } # https://github.com/encode/uvicorn
django = ">=5" # https://www.djangoproject.com/
django-environ = ">=0.11.2" # https://github.com/joke2k/django-environ
django-model-utils = ">=4.4.0" # https://github.com/jazzband/django-model-utils
django-allauth = ">=0.61.1" # https://github.com/pennersr/django-allauth
django-crispy-forms = ">=2.1" # https://github.com/django-crispy-forms/django-crispy-forms
django-anymail = ">=10.2" # https://github.com/anymail/django-anymail
crispy-bootstrap5 = ">=2023.10" # https://github.com/django-crispy-forms/crispy-bootstrap5
django-compressor = ">=4.4" # https://github.com/django-compressor/django-compressor
django-redis = ">=5.4.0" # https://github.com/jazzband/django-redis
djangorestframework = ">=3.14.0" # https://github.com/encode/django-rest-framework
django-cors-headers = ">=4.3.1" # https://github.com/adamchainz/django-cors-headers
drf-spectacular = ">=0.27.1" # https://github.com/tfranzel/drf-spectacular
gunicorn = ">=21.2.0" # https://github.com/benoitc/gunicorn
psycopg = {version = ">=3.1.18", extras = ["binary"]} # https://github.com/psycopg/psycopg
sentry-sdk = ">=1.40.4" # https://github.com/getsentry/sentry-python
django-form-surveys = ">=2.0.4"
[tool.poetry.dev-dependencies]
pytest = ">=8.0"
pytest-cov = ">=4.1.0"
pre-commit = ">=3.3.2"
ruff = ">=0.2.2"
mypy = ">=1.7.0,<1.8"
bandit = ">=1.7.5"
vulture = ">=2.7"
mccabe = ">=0.6.1"
compose-go = ">=2.18.1"
ipython = ">=8"
ipykernel = ">=6.0.0"
Jinja2 = ">=3.1.2"
mkdocs = ">=1.4.3"
mkdocs-exclude = ">=1.0.2"
mkdocs-jupyter = ">=0.24.1"
mkdocs-literate-nav = ">=0.6.0"
mkdocs-macros-plugin = ">=0.7.0,<1"
mkdocs-material = ">=9.1.15"
mkdocstrings = ">=0.21.2"
mkdocstrings-python = ">=1.1.2"
makim = "1.13.0"
containers-sugar = "1.11.1"
Werkzeug = {version = ">=3.0.1", extras = ["watchdog"] } # https://github.com/pallets/werkzeug
ipdb = ">=0.13.13" # https://github.com/gotcha/ipdb
watchfiles = ">=0.21.0" # https://github.com/samuelcolvin/watchfiles
django-stubs = {version = ">=4.2.7", extras = ["compatible-mypy"]} # https://github.com/typeddjango/django-stubs
pytest-sugar = ">=1.0.0" # https://github.com/Frozenball/pytest-sugar
djangorestframework-stubs = {version = ">=3.14.5", extras = ["compatible-mypy"]} # https://github.com/typeddjango/djangorestframework-stubs
coverage = ">=7.4.1" # https://github.com/nedbat/coveragepy
djlint = ">=1.34.1" # https://github.com/Riverside-Healthcare/djLint
factory-boy = ">=3.3.0" # https://github.com/FactoryBoy/factory_boy
django-debug-toolbar = ">=4.3.0" # https://github.com/jazzband/django-debug-toolbar
django-extensions = ">=3.2.3" # https://github.com/django-extensions/django-extensions
django-coverage-plugin = ">=3.1.0" # https://github.com/nedbat/django_coverage_plugin
pytest-django = ">=4.8.0" # https://github.com/pytest-dev/pytest-django
[tool.bandit]
exclude_dirs = ["tests"]
targets = "./"
[tool.vulture]
exclude = ["tests"]
ignore_decorators = ["@abc.abstractmethod"]
ignore_names = []
make_whitelist = true
min_confidence = 80
paths = ["./"]
sort_by_size = true
verbose = false
# ==== pytest ====
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--ds=config.settings.test --reuse-db"
python_files = [
"tests.py",
"test_*.py",
]
# ==== Coverage ====
[tool.coverage.run]
include = ["src/growth_forge/**"]
omit = ["*/migrations/*", "*/tests/*"]
plugins = ["django_coverage_plugin"]
# ==== mypy ====
[tool.mypy]
python_version = "3.11"
strict = true
check_untyped_defs = true
ignore_missing_imports = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_unused_configs = true
files = ["./src/growth_forge"]
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.mypy.overrides]]
module = "NewSemanalDjangoPlugin"
ignore_errors = true
# ==== djLint ====
[tool.django-stubs]
django_settings_module = "config.settings.test"
strict_settings = false
ignore_missing_model_attributes = true
# [[tool.mypy.overrides]]
# module = "growth_forge.forms"
# ignore_errors = true
[[tool.mypy.overrides]]
module = "NewSemanalDjangoPlugin"
ignore_errors = true
# ==== djLint ====
[tool.djlint]
blank_line_after_tag="load,extends,include"
blank_line_before_tag="load,extends,include,block"
close_void_tags = true
format_attribute_template_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
line_break_after_multiline_tag=true
max_attribute_length=3
max_blank_lines=1
max_line_length=79
profile = "django"
preserve_blank_lines=false
[tool.djlint.html]
indent_size=2
[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/*",
'docs',
]
# Same as Django: https://github.com/cookiecutter/cookiecutter-django/issues/4792.
line-length = 79
indent-width = 4
target-version = "py38"
force-exclude = true
src = ["./"]
fix = true
[tool.ruff.lint]
select = [
# "D", # pydocstyle
"F",
"E",
"W",
"C90",
"I",
"I001", # isort
"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`
"PLR0913",
"COM812",
"ISC001",
]
# 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 = "single"
indent-style = "space"
# skip-magic-trailing-comma = false
line-ending = "auto"
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.isort]
# Use a single line between direct and from import
lines-between-types = 1
[tool.ruff.lint.flake8-quotes]
# docstring-quotes = "double"
inline-quotes = "single"
# multiline-quotes = "double"