forked from WeblateOrg/weblate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
410 lines (389 loc) · 12.2 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
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=61.2", "translate-toolkit"]
[project]
authors = [{name = "Michal Čihař", email = "[email protected]"}]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"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",
"Topic :: Software Development :: Internationalization",
"Topic :: Software Development :: Localization",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content"
]
dependencies = [
"aeidon>=1.14.1,<1.15",
"ahocorasick-rs>=0.20.0,<0.23.0",
"borgbackup>=1.2.5,<1.3",
"celery[redis]>=5.4.0,<5.5",
"certifi>=2023.7.22",
"charset-normalizer>=2.0.12,<4.0",
"crispy-bootstrap3==2024.1",
"cryptography>=42.0.2",
"cssselect>=1.2,<1.3",
"Cython>=3.0.0,<3.1",
"diff-match-patch==20230430",
"django-appconf>=1.0.3,<1.1",
"django-celery-beat>=2.6.0,<2.7",
"django-compressor>=4.4,<5",
"django-cors-headers>=4.3.0,<4.4",
"django-crispy-forms>=2.1,<2.2",
"django-filter>=23.4,<24.3",
"django-redis>=5.4.0,<6.0",
"Django[argon2]>=5.0,<5.1",
"djangorestframework>=3.15.0,<3.16",
"filelock<4,>=3.12.2",
"fluent.syntax>=0.18.1,<0.20",
"GitPython>=3.1.0,<3.2",
"hiredis>=2.2.1,<2.4",
"html2text>=2024.2.25,<2024.2.27",
"iniparse==0.5",
"jsonschema>=4.5,<5",
"lxml>=5.2.0,<5.3",
"misaka>=2.1.0,<2.2",
"mistletoe>=1.3.0,<1.4",
"nh3>=0.2.14,<0.3",
"openpyxl>=3.1.0,<3.2",
"packaging>=22,<24.1",
"phply>=1.2.6,<1.3",
"Pillow>=10.3.0,<10.4",
"pycairo>=1.20.0",
"Pygments>=2.15.0,<3.0",
"PyGObject>=3.40.1",
"pyicumessageformat>=1.0.0,<1.1",
"pyparsing>=3.1.1,<3.2",
"python-dateutil>=2.8.2",
"python-redis-lock[django]>=4,<4.1",
"rapidfuzz>=2.6.0,<3.10",
"redis>=5.0.2,<5.1.0",
"requests>=2.31.0,<2.32",
"ruamel.yaml>=0.17.2,<0.19.0",
"sentry-sdk>=1.45.0,<2.0",
"siphashc>=2.1,<3.0",
"social-auth-app-django>=5.4.0,<6.0.0",
"social-auth-core>=4.5.0,<5.0.0",
"tesserocr>=2.6.1,<2.8.0",
"translate-toolkit>=3.13.0,<3.14",
"translation-finder>=2.16,<3.0",
"user-agents>=2.0,<2.3",
"weblate-language-data>=2024.3",
"weblate-schemas==2024.1"
]
description = "A web-based continuous localization system with tight version control integration"
dynamic = ["version"]
keywords = [
"i18n",
"l10n",
"gettext",
"git",
"mercurial",
"translate"
]
license = {text = "GPLv3+"}
name = "Weblate"
requires-python = ">=3.10"
[project.optional-dependencies]
alibaba = [
"aliyun-python-sdk-alimt>=3.2.0,<4.0.0"
]
all = [
"Weblate[alibaba,amazon,antispam,gerrit,google,ldap,mercurial,openai,postgres,saml,zxcvbn]"
]
amazon = [
"boto3>=1.28.62,<1.35.0"
]
antispam = [
"python-akismet>=0.4.2,<0.5"
]
ci = [
"build==1.2.1",
"coverage==7.5.1",
"pip==24.0",
"setuptools==69.5.1",
"twine==5.0.0",
"virtualenv==20.26.1",
"wheel==0.43.0"
]
dev = [
"Weblate[all,ci,test,lint,mypy]",
"django-debug-toolbar==4.3.0",
"PyICU==2.13.1",
"reuse==3.0.2",
"scour==0.38.2",
"tinyunicodeblock==1.3",
"tomli"
]
gerrit = [
"git-review>=2.2.0,<2.5.0"
]
google = [
"google-cloud-translate>=3.8.0,<3.16.0"
]
ldap = [
"django-auth-ldap>=4.6.0,<5.0.0"
]
lint = [
"pre-commit==3.7.1",
"pylint==3.1.0"
]
mercurial = [
"mercurial>=6.2,<7.0"
]
mypy = [
"boto3-stubs==1.34.103",
"celery-types==0.22.0",
"django-stubs-ext==5.0.0",
"django-stubs==5.0.0",
"djangorestframework-stubs==3.15.0",
"types-lxml==2024.4.14",
"mypy==1.10.0",
"types-jsonschema==4.22.0.20240501",
"types-openpyxl==3.1.0.20240428",
"types-Pillow==10.2.0.20240511",
"types-python-dateutil==2.9.0.20240316",
"types-requests==2.31.0.20240406"
]
mysql = [
"mysqlclient>=2.1.1,<3"
]
openai = [
"openai>=1.3.0,<1.29"
]
postgres = [
"psycopg[binary]>=3.1.8,<4"
]
saml = [
"python3-saml>=1.2.1"
]
test = [
"responses==0.25.0",
"respx==0.21.1",
"selenium==4.20.0"
]
zxcvbn = ["django-zxcvbn-password==2.1.1"]
[project.readme]
content-type = "text/x-rst"
file = "README.rst"
[project.scripts]
weblate = "weblate.runner:main"
weblate-generate-secret-key = "weblate.utils.generate_secret_key:main"
[project.urls]
Documentation = "https://docs.weblate.org/"
Download = "https://weblate.org/download/"
Funding = "https://weblate.org/donate/"
Homepage = "https://weblate.org/"
"Issue Tracker" = "https://github.com/WeblateOrg/weblate/issues"
"Release Notes" = "https://docs.weblate.org/en/latest/changes.html"
"Source Code" = "https://github.com/WeblateOrg/weblate"
Twitter = "https://twitter.com/WeblateOrg"
[tool.black]
target-version = ['py310']
[tool.codespell]
count = true
# TODO: the per-file ignores should use inlines once supported by codespell
skip = '*.po,*.pot,*.json,*.tmx,*.tbx,*.csv,yarn.lock,known_hosts,*/vendor/*,weblate/checks/tests/test_chars_checks.py,weblate/checks/tests/test_fluent_checks.py,weblate/checks/tests/test_format_checks.py,weblate/checks/tests/test_duplicate_checks.py,weblate/checks/tests/test_icu_checks.py,weblate/machinery/aws.py,weblate/machinery/baidu.py,weblate/machinery/apertium.py,weblate/machinery/saptranslationhub.py,weblate/screenshots/views.py,weblate/trans/specialchars.py,weblate/checks/data.py,weblate/machinery/alibaba.py,weblate/formats/base.py,weblate/formats/tests/test_multi.py,weblate/vcs/gpg.py,scripts/yarn/yarn.lock,weblate/trans/tests/data/known_hosts,scripts/generate-specialchars,docs/user/checks.rst'
[tool.django-stubs]
django_settings_module = "weblate.settings_example"
strict_settings = false
[tool.mypy]
check_untyped_defs = true
plugins = [
"mypy_django_plugin.main",
"mypy_drf_plugin.main"
]
[[tool.mypy.overrides]]
# TODO: remove this once core can be validated with mypy
ignore_errors = true
module = [
"weblate.*.tests",
"weblate.*.tests.*"
]
[[tool.mypy.overrides]]
disallow_untyped_defs = true
ignore_missing_imports = true
module = [
"simple_sso.*",
"social_django.*",
"social_core.*",
"ruamel.*",
"aliyunsdkcore.*",
"aliyunsdkalimt.*",
"google.oauth2.*",
"user_agents.*",
"translation_finder.*",
"weblate_language_data.*",
"django_redis.*",
"pygments.*",
"redis_lock.*",
"borg.*",
"rollbar.*",
"crispy_forms.*",
"akismet.*",
"gi.*",
"misaka.*",
"diff_match_patch.*",
"saml2.*",
"ldap.*",
"django_auth_ldap.*",
"pyicumessageformat.*",
"django_filters.*",
"tesserocr.*",
"django_celery_beat.*",
"translate.*",
"appconf.*",
"wllegal.*",
"wlhosted.*",
"djangosaml2idp.*",
"debug_toolbar.*",
"weblate_schemas.*",
"django.db.backends.postgresql.psycopg_any"
]
[tool.pylint.main]
disable = [
"C",
"W",
"R",
"I",
"no-member",
"not-a-mapping",
"unsubscriptable-object",
"unsupported-membership-test",
"not-an-iterable",
"unsupported-binary-operation",
"c-extension-no-member",
"not-callable",
"invalid-str-returned",
"raising-bad-type",
"no-name-in-module",
"import-error"
]
extension-pkg-whitelist = ["siphashc"]
ignore = [
"migrations",
"settings.py",
"settings_test.py",
".git",
"test-repos",
"repos",
"build",
".venv"
]
[tool.ruff]
target-version = "py310"
[tool.ruff.lint]
extend-safe-fixes = [
"D",
"TCH",
"FLY",
"SIM",
"ANN",
"FA102",
"UP"
]
# CONFIG - intentional configuration
# TODO - needs decision whether intention, add noqa tags or fix
# WONTFIX - not fixable in current codebase, might be better to go for noqa
ignore = [
"COM", # CONFIG: No trailing commas
"PT", # CONFIG: Not using pytest
"D203", # CONFIG: incompatible with D211
"D212", # CONFIG: incompatible with D213
"FIX002", # CONFIG: we use TODO
"TD002", # CONFIG: no detailed TODO documentation is required
"TD003", # CONFIG: no detailed TODO documentation is required
"S404", # CONFIG: `subprocess` module is possibly insecure
"S603", # CONFIG: `subprocess` call: check for execution of untrusted input
"S607", # CONFIG: executing system installed tools
"D206", # CONFIG: formatter
'ISC001', # CONFIG: formatter
'Q000', # CONFIG: formatter
'Q001', # CONFIG: formatter
'Q002', # CONFIG: formatter
'Q003', # CONFIG: formatter
'W191', # CONFIG: formatter
"E203", # CONFIG: formatter
"EM", # TODO: Exception strings
"PTH", # TODO: Not using pathlib
"FBT", # TODO: Boolean in function definition
"BLE001", # WONTFIX: Do not catch blind exception: `Exception`, third-party modules do not have defined exceptions
"ARG001", # TODO: Unused function argument (mostly for API compatibility)
"ARG002", # TODO: Unused method argument (mostly for API compatibility)
"ANN001", # TODO: Missing type annotation for function argument
"ANN002", # TODO: Missing type annotation for `*args`
"ANN003", # TODO: Missing type annotation for `**kwargs`
"ANN101", # TODO: Missing type annotation for `self` in method
"ANN102", # TODO: Missing type annotation for `cls` in classmethod
"ANN201", # TODO: Missing return type annotation for public function
"ANN202", # TODO: Missing return type annotation for private function
"ANN204", # TODO: Missing return type annotation for special method
"ANN205", # TODO: Missing return type annotation for staticmethod
"ANN206", # TODO: Missing return type annotation for classmethod
"D100", # TODO: Missing docstring in public module
"D101", # TODO: Missing docstring in public class
"D102", # TODO: Missing docstring in public method
"D103", # TODO: Missing docstring in public function
"D104", # TODO: Missing docstring in public package
"D105", # TODO: Missing docstring in magic method
"D106", # TODO: Missing docstring in public nested class
"D107", # TODO: Missing docstring in `__init__`
"TRY003", # WONTFIX: Avoid specifying long messages outside the exception class
"B904", # TODO: Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling
"PERF203", # WONTFIX: This rule is only enforced for Python versions prior to 3.11
"PLR6301", # TODO: Method could be a function, class method, or static method
"PLR2004", # TODO: Magic value used in comparison, consider replacing 201 with a constant variable
"PLC0415", # TODO: `import` should be at the top-level of a file
"RUF001", # WONTFIX: String contains ambiguous unicode character, we are using Unicode
"RUF012", # TODO: Mutable class attributes should be annotated with `typing.ClassVar`
"E501", # WONTFIX: we accept long strings (rest is formatted by black)
"PLW2901", # TODO: overwriting variables inside loop
"PLW1514", # TODO: `open` in text mode without explicit `encoding` argument
"FURB101", # TODO: `open` and `read` should be replaced by `Path(hostsfile).read_text()`
"FURB103", # TODO: `open` and `write` should be replaced by `Path(name).write_text(content)`
"SLF001" # TODO: Private member accessed (might need noqa tags)
]
preview = true
select = ["ALL"]
[tool.ruff.lint.flake8-copyright]
min-file-size = 2
# Copyright without a year, see https://github.com/astral-sh/ruff/issues/10062
notice-rgx = "(?i)Copyright\\s+©\\s+"
[tool.ruff.lint.mccabe]
max-complexity = 16 # TODO: should be lower
[tool.ruff.lint.per-file-ignores]
"docs/_ext/djangodocs.py" = ["INP001"]
"docs/conf.py" = ["INP001", "ERA001"]
"scripts/*" = ["T201", "T203"]
"weblate/*/tests**.py" = ["S106", "S105"]
"weblate/auth/migrations/0003_fixup_teams.py" = ["T201"]
"weblate/examples/*.py" = ["INP001"]
"weblate/settings_*.py" = ["F405"]
"weblate/settings_example.py" = ["ERA001"]
"weblate/utils/generate_secret_key.py" = ["T201"]
[tool.ruff.lint.pylint]
# TODO: all these should be lower (or use defaults)
max-args = 12
max-bool-expr = 8
max-branches = 36
max-locals = 23
max-nested-blocks = 9
max-positional-args = 8
max-public-methods = 180
max-returns = 21
max-statements = 100
[tool.setuptools]
include-package-data = true
zip-safe = false
[tool.setuptools.dynamic]
version = {attr = "weblate.utils.version.VERSION"}
[tool.setuptools.packages]
find = {namespaces = false}