-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
271 lines (245 loc) · 6.3 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
# SPDX-FileCopyrightText: 2024 JWP Consulting GK
#
# SPDX-License-Identifier: AGPL-3.0-or-later
[tool.poetry]
name = "projectify"
version = "2025.3.6"
description = "Projectify Backend"
maintainers = ["Justus Perlwitz <justus@jwpconsulting.net>"]
authors = ["The Projectify Authors"]
readme = "README.md"
exclude = [
"projectify/*/test",
]
[tool.poetry.dependencies]
celery = {extras = ["redis"], version = "~5.4"}
channels = {version = "^4.1.0", extras = ["daphne"]}
channels-redis = "^4.2"
cryptography = "^44.0.1"
dj-database-url = "~2.1.0"
django = "^5.1.5"
django-anymail = {extras = ["mailgun"], version = "~10.3"}
django-celery-results = "~2.5.0"
django-cloudinary-storage = "~0.3.0"
django-configurations = "^2.5.1"
django-pgtrigger = "~4.11.0"
djangorestframework = "^3"
gunicorn = "^22"
newrelic = "^9"
pillow = "^10.3.0"
psycopg = {version = "^3.1.18", extras = ["c"]}
python = "~3.12.7"
redis = "^5"
rules = "^3.3"
stripe = "^8"
uvicorn = "~0.17.6"
websockets = "~10.3"
whitenoise = "~6.2.0"
django-ratelimit = "^4.1.0"
django-tailwind = {extras = ["reload"], version = "^3.8.0"}
django-components = "^0.114"
[tool.poetry.group.dev]
[tool.poetry.group.dev.dependencies]
python-dotenv = "^1"
faker = "^19.13.0"
django-extensions = "~3.2.0"
# Strictly only used for local development
django-debug-toolbar = "^4.3.0"
ipython = "~8.22"
ruff = "0.6.1"
drf-spectacular = {extras = ["sidecar"], version = "^0.27.2"}
[tool.poetry.group.test]
[tool.poetry.group.test.dependencies]
celery-types = "~0.20.0"
django-test-migrations = "^1.3"
django-types = "~0"
mypy = "^1.10"
pyright = "~1.1.318"
pytest = "^8"
pytest-asyncio = "^0.23"
pytest-celery = "~0.0.0"
pytest-cov = "^5.0.0"
pytest-django = "~4.5.2"
pytest-xdist = {extras = ["psutil"], version = "~3.3.1"}
types-redis = "~4.6.0.5"
vulture = "^2.9.1"
types-requests = "^2.32.0.20240712"
djlint = "^1.36.1"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
line-length=79
extend-exclude = [
# Nix build
"result/",
]
[tool.ruff.lint]
extend-select = [
"I",
"E",
"D",
"C901",
# TODO add
# "C",
"F",
# TODO add
# "DJ",
# TODO add
# "T20",
# There are so many more out there, they all look interesting:
# https://docs.astral.sh/ruff/rules/
]
ignore = [
# Conflicting with D201
"D203",
# Conflicting with D213
"D212",
"E501",
]
[tool.ruff.lint.mccabe]
# Upgrading ruff recently made this metric a lot more sensitive
# I therefore increase it to 12 to make tests pass
# and will at some point decrease complexity in the affected
# again.
max-complexity = 12
[tool.ruff.lint.isort]
section-order = [
"future",
"standard-library",
"django",
"third-party",
"first-party",
"local-folder",
]
split-on-trailing-comma = false
[tool.ruff.lint.isort.sections]
django = [
"django"
]
# third-party = [
# "asgiref",
# "channels",
# "pytest",
# "rest_framework"
# ]
[tool.mypy]
mypy_path = [
"mypy/stubs",
]
strict = true
exclude = [
".git",
"__pycache__",
"docs",
"whitelist.py",
".direnv",
"result",
]
# Library imports
[[tool.mypy.overrides]]
module = [
"cloudinary.*",
"pgtrigger.*",
]
ignore_missing_imports = true
# Our own modules
[[tool.mypy.overrides]]
module = [
"projectify.premail.tasks",
]
disallow_untyped_decorators = false
[[tool.mypy.overrides]]
module = [
"projectify.workspace.test.test_migrations",
"projectify.premail.test.*",
]
disallow_untyped_defs = false
[tool.pyright]
stubPath = "mypy/stubs"
typeCheckingMode = "strict"
typeshedPath = ""
exclude = [
".direnv",
"**/__pycache__/",
# TODO consider just removing whitelist.py
"whitelist.py",
# Created by django so we don't bother
"projectify/*/migrations/*.py",
# Missing type stub
"projectify/workspace/test/test_migrations.py",
# This one is sort of covered by mypy
"projectify/settings/monkeypatch.py",
# TODO cloudinary stub
"projectify/utils.py",
# TODO django rules stub
"projectify/*/rules.py",
# TODO write typings
"projectify/premail/views.py",
"projectify/premail/test/test_views.py",
"projectify/premail/test/test_emails.py",
# TODO typing for spectacular is underspecified
"projectify/lib/error_schema.py",
# Nix build
"result",
# spectacular classes are being overriden here, we avoid having
# to conditonally ignore no-redef (mypy) or reportAssignmentType (pyright)
"projectify/lib/schema.py",
]
# Mypy doesn't complain about these, so it's fine
reportUnknownParameterType = true
reportPrivateUsage = false
reportIncompatibleVariableOverride = false
reportTypeCommentUsage = false
reportMissingTypeStubs = false
reportUnknownMemberType = false
reportUnusedImport = false
[tool.vulture]
ignore_decorators = ["@receiver", "@admin.register"]
exclude = [
"apps.py",
"conftest.py",
"settings",
"migrations",
"result/",
]
min_confidence = 70
[tool.coverage.run]
include=["projectify/**/*.py"]
[tool.coverage.report]
skip_covered = true
skip_empty = true
show_missing = true
sort = "-cover"
[tool.coverage.html]
[tool.pytest.ini_options]
pythonpath = [
"projectify",
]
norecursedirs = [
"result",
".direnv",
]
FAIL_INVALID_TEMPLATE_VARS = "True"
DJANGO_SETTINGS_MODULE = "projectify.settings.test"
DJANGO_CONFIGURATION = "Test"
asyncio_mode = "auto"
junit_family = "xunit1"
filterwarnings = [
"error",
# Wait for celery to get kombu upgraded
"ignore:SelectableGroups dict interface is deprecated. Use select.:DeprecationWarning",
# Some issue with daphne or twisted
"ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning",
# Some issue with django-configurations
"ignore:The FORMS_URLFIELD_ASSUME_HTTPS transitional setting is deprecated:django.utils.deprecation.RemovedInDjango60Warning",
# Again, another issue with djagno-configurations
# https://github.com/jazzband/django-configurations/issues/367
"ignore:the imp module is deprecated:DeprecationWarning",
"ignore:ConfigurationImporter:ImportWarning",
"ignore:ConfigurationLoader:ImportWarning",
"ignore:ConfigurationLoader:ImportWarning",
# XXX
# Can't fix this yet, need to wait for django type stubs to be updated
"ignore:CheckConstraint.check:django.utils.deprecation.RemovedInDjango60Warning"
]