-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
356 lines (342 loc) · 9.89 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
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
[build-system]
requires = ["hatchling>=1.22.5"]
build-backend = "hatchling.build"
[project]
name = "meringue"
description = "A set of various functionality for a Django based web application."
readme = "README.md"
requires-python = ">=3.10"
license = "LGPL-3.0"
authors = [
{ name = "Dmitry Dobrynin", email = "[email protected]" },
]
keywords = ["django", "utils"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Plugins",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 2",
"Framework :: Django :: 2.0",
"Framework :: Django :: 2.1",
"Framework :: Django :: 2.2",
"Framework :: Django :: 3",
"Framework :: Django :: 3.0",
"Framework :: Django :: 3.1",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Natural Language :: English",
# "Natural Language :: Russian",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: WSGI",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Software Development :: Libraries",
]
dependencies = [
"Django>=2.0.0,<6",
]
dynamic = ["version"]
[project.optional-dependencies]
modeltranslation = ["django-modeltranslation>=0.17,<0.19"]
drf = ["djangorestframework>=3.13,<4"]
drf-spectacular = ["drf-spectacular>=0.26.3,<1"]
cryptodome = ["pycryptodome==3.20.0"]
django_hosts = ["django_hosts>=5.2,<7"]
[project.urls]
"Documentation" = "https://dd.github.io/Meringue"
"Repository" = "https://github.com/dd/Meringue"
"Changelog" = "https://github.com/dd/Meringue/blob/master/CHANGELOG.md"
"Bug Tracker" = "https://github.com/dd/Meringue/issues"
[tool.hatch.version]
path = "meringue/__init__.py"
[tool.hatch.build]
include = [
"meringue",
"AUTHORS",
]
exclude = [
"/docs",
".gitignore",
"CHANGELOG.md",
"CONTRIBUTING.md",
"tests",
]
[tool.hatch.envs.default]
description = "Dev environment"
python = "3.12"
dependencies = [
"pre-commit==3.7.0",
"ipython==8.23.0",
"django==5.0.4",
"pytz==2024.1",
"django-modeltranslation==0.18.11",
"pycryptodome==3.20.0",
"djangorestframework==3.15.1",
"djangorestframework-simplejwt==5.3.1",
"drf-spectacular==0.27.2",
"Pillow==10.3.0",
"django_hosts==6.0",
]
[tool.hatch.envs.default.env-vars]
DJANGO_SETTINGS_MODULE = "test_project.settings"
PYTHONPATH = "."
[tool.hatch.envs.default.scripts]
precommit_install = "pre-commit install {args}"
precommit_uninstall = "pre-commit uninstall {args}"
init = [
"git config --local gitflow.branch.master \"master\"",
"git config --local gitflow.branch.develop \"dev\"",
"git config --local gitflow.prefix.feature \"feature/\"",
"git config --local gitflow.prefix.bugfix \"bugfix/\"",
"git config --local gitflow.prefix.release \"release/\"",
"git config --local gitflow.prefix.hotfix \"hotfix/\"",
"git config --local gitflow.prefix.support \"support/\"",
"git config --local gitflow.prefix.versiontag \"v\"",
"git config --local gitflow.path.hooks $(pwd)\"/.git/hooks\"",
"precommit_install",
]
remove = [
"git config --local --remove-section gitflow.branch",
"git config --local --remove-section gitflow.prefix",
"git config --local --remove-section gitflow.path",
"precommit_uninstall",
]
makemessages = "cd meringue/core && django-admin makemessages -l en -l ru --no-obsolete {args}"
compilemessages = "cd meringue && django-admin compilemessages -l en -l ru {args}"
changelog-update = [
"git fetch origin --tags",
"gitmoji-changelog update \"$(hatch version)\" --preset generic --group-similar-commits",
]
[tool.hatch.envs.lint]
description = "Lint environment"
detached = true
python = "3.12"
dependencies = [
"ruff==0.3.5",
"black==24.3.0",
]
[tool.hatch.envs.lint.scripts]
check = [
"ruff {args:.}",
"black --check --diff --exclude=\".*migrations\\/.*$\" {args:.}",
]
format = [
"ruff --fix {args:.}",
"black --exclude=\".*migrations\\/.*$\" {args:.}",
]
[tool.hatch.envs.test]
description = "Tests environment"
detached = true
python = "3.12"
dependencies = [
"pytest==8.1.1",
"pytest-django==4.8.0",
"pytest-cov==5.0.0", # for ci tests with cover
"Faker==24.7.1",
"pytz==2024.1",
"pycryptodome==3.20.0",
"drf-spectacular==0.27.2",
"pillow==10.3.0",
"django==5.0.4",
"django-modeltranslation==0.18.11",
"djangorestframework==3.15.1",
"djangorestframework-simplejwt==5.3.1",
"django_hosts==6.0",
]
[tool.hatch.envs.test.env-vars]
DJANGO_SETTINGS_MODULE = "test_project.settings"
PYTHONPATH = "."
[tool.hatch.envs.test.scripts]
check = "pytest {args:--cov=meringue --cov-report term-missing}"
makemigrations = "django-admin makemigrations {args}"
[tool.hatch.envs.mtest]
description = "Test matrix environment"
detached = true
dependencies = [
"pytest==8.1.1",
"pytest-django==4.8.0",
"pytest-cov==5.0.0", # for ci tests with cover
"Faker==24.7.1",
"pytz==2024.1",
"pycryptodome==3.20.0",
"drf-spectacular==0.27.2",
"pillow==10.3.0",
]
[tool.hatch.envs.mtest.overrides]
matrix.django.dependencies = [
{ value = "django~={matrix:django}" },
{ value = "django-modeltranslation=={matrix:modeltranslation}" },
{ value = "djangorestframework=={matrix:djangorestframework}" },
{ value = "djangorestframework-simplejwt=={matrix:simplejwt}" },
{ value = "django_hosts=={matrix:django_hosts}" },
]
[tool.hatch.envs.mtest.env-vars]
DJANGO_SETTINGS_MODULE = "test_project.settings"
PYTHONPATH = "."
[tool.hatch.envs.mtest.scripts]
check = "pytest {args:-q}"
[[tool.hatch.envs.mtest.matrix]]
python = ["3.10", "3.11"]
django = ["2.0"]
modeltranslation = ["0.17.0", "0.18.2"]
djangorestframework = ["3.13.0"]
simplejwt = ["5.2.0"]
django_hosts = ["5.2", "6.0"]
[[tool.hatch.envs.mtest.matrix]]
python = ["3.10", "3.11"]
django = ["3.0"]
modeltranslation = ["0.17.0", "0.18.2"]
djangorestframework = ["3.13.0", "3.14.0", "3.15.0"]
simplejwt = ["5.2.0", "5.3.0"]
django_hosts = ["5.2", "6.0"]
[[tool.hatch.envs.mtest.matrix]]
python = ["3.10", "3.11"]
django = ["4.0"]
modeltranslation = ["0.17.0", "0.18.2"]
djangorestframework = ["3.14.0", "3.15.0"]
simplejwt = ["5.2.0", "5.3.0"]
django_hosts = ["5.2", "6.0"]
[[tool.hatch.envs.mtest.matrix]]
python = ["3.12"]
django = ["4.0"]
modeltranslation = ["0.17.0", "0.18.2"]
djangorestframework = ["3.14.0", "3.15.0"]
simplejwt = ["5.3.1"]
django_hosts = ["6.0"]
[[tool.hatch.envs.mtest.matrix]]
python = ["3.10", "3.11", "3.12"]
django = ["5.0"]
modeltranslation = ["0.17.0", "0.18.2"]
djangorestframework = ["3.15.0"]
simplejwt = ["5.3.1"]
django_hosts = ["6.0"]
[tool.hatch.envs.docs]
description = "Docs environment"
detached = true
python = "3.12"
dependencies = [
"mkdocs[i18n]==1.5.3",
"mkdocs-literate-nav==0.6.1",
"mkdocs-material==9.5.17",
"mkdocs-git-revision-date-localized-plugin==1.2.4",
"mkdocs-git-authors-plugin==0.8.0",
"mkdocstrings[python]==0.24.3",
"black==24.3.0",
"mkdocs-minify-plugin==0.8.0",
"mkdocs-gen-files==0.5.0",
"Pygments==2.17.2",
"mike==2.0.0",
"linkchecker==10.4.0",
]
[tool.hatch.envs.docs.env-vars]
MERINGUE_MKDOCS_ENABLE_MINIFY = "false"
MKDOCS_CONFIG = "mkdocs.yml"
[tool.hatch.envs.docs.scripts]
build = "mkdocs build --config-file {env:MKDOCS_CONFIG} --clean --strict {args}"
serve = "mkdocs serve --config-file {env:MKDOCS_CONFIG} --dev-addr localhost:8000 {args}"
ci-build = "mike deploy --config-file {env:MKDOCS_CONFIG} --update-aliases {args}"
validate = "linkchecker --config .linkcheckerrc docs/dist"
build-check = [
"build --no-directory-urls",
"validate",
]
[tool.black]
line-length = 100
target-version = ["py310"]
[tool.ruff]
target-version = "py310"
line-length = 100
show-fixes = true
# update-check = true
select = [
"A",
"B",
"C",
"DTZ",
"E",
"EM",
"F",
"I",
"ICN",
"ISC",
"N",
"PLC",
"PLE",
"PLR",
"PLW",
"Q",
"RUF",
"S",
"SIM",
"T",
"TID",
"UP",
"W",
"YTT",
]
ignore = [
"RUF001", # Allow similar characters like latin `c` and cyrillic `с`
"RUF002", # Allow russian at docstrings
"RUF003", # Allow russian at comment
"PLR0913", # Allow any number of function arguments
"E741", # Allow variables of like "l", "O", "i"
# # Allow non-abstract empty methods in abstract base classes
# "B027",
# # Ignore checks for possible passwords
# "S105", "S106", "S107",
# # Ignore complexity
# "C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
# "PLC1901", # empty string comparisons
# "PLW2901", # `for` loop variable overwritten
"SIM114", # Combine `if` branches using logical `or` operator
]
# unfixable = [
# # Don't touch unused imports
# "F401",
# ]
[tool.ruff.extend-per-file-ignores]
"__init__.py" = ["F401", "F403"]
"test_*.py" = ["S101", "PLR2004", "DTZ001", "RUF012"]
"*/migrations/*" = ["I", "E", "Q", "RUF"]
"test_project/*models.py" = ["RUF012"]
"test_project/*views.py" = ["RUF012"]
[tool.ruff.flake8-import-conventions]
[tool.ruff.flake8-import-conventions.extend-aliases]
"datetime" = "dt"
# [tool.ruff.flake8-quotes]
# inline-quotes = "single"
[tool.ruff.flake8-unused-arguments]
ignore-variadic-names = true
[tool.ruff.isort]
force-single-line = true
known-first-party = ["meringue"]
lines-after-imports = 2
no-lines-before = ["local-folder"]
section-order = ["future", "standard-library", "django", "third-party", "first-party", "local-folder"]
[tool.ruff.isort.sections]
django = ["django"]
[tool.isort]
known_first_party = ["meringue"]
lines_after_imports = 2
no_lines_before = ["LOCALFOLDER"]
known_django = "django"
sections = ["FUTURE", "STDLIB", "DJANGO", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
force_single_line = true
[tool.coverage.run]
omit = ["*/tests/*"]
source = ["meringue"]