-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpyproject.toml
More file actions
155 lines (139 loc) · 4.15 KB
/
Copy pathpyproject.toml
File metadata and controls
155 lines (139 loc) · 4.15 KB
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
[tool.poetry]
name = "swat4stats"
version = "0.226.0"
description = "Source code to swat4stats.com backend"
authors = ["Sergei Khoroshilov <kh.sergei@gmail.com>"]
license = "MIT"
readme = "README.md"
package-mode = false
[tool.poetry.dependencies]
python = "^3.14,<3.15"
Django = "6.0.3"
celery = "5.6.2"
bleach = "6.3.0"
pytz = "2025.2"
Markdown = "3.10.2"
psycopg = {extras = ["binary"], version = "3.3.3"}
redis = "7.2.1"
uwsgi = "2.0.31"
python-dateutil = "2.9.0.post0"
ipwhois = "1.3.0"
django-cacheback = "4.0.0"
django-debug-toolbar = "6.2.0"
django-countries = "8.2.0"
django-filter = "25.2"
djangorestframework = "3.16.1"
voluptuous = "0.16.0"
aiohttp = "3.13.3"
django-redis = "6.0.0"
sentry-sdk = "2.53.0"
[tool.poetry.group.dev.dependencies]
coverage = "7.13.4"
Faker = "40.5.1"
factory-boy = "3.3.3"
pytest = "9.0.2"
pytest-django = "4.12.0"
pytest-localserver = "0.10.0"
pytest-cov = "7.0.0"
pytest-repeat = "0.9.4"
mypy = "1.19.1"
types-pytz = "2025.2.0.20251108"
ruff = "0.15.4" # also update the version in .pre-commit-config.yaml
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "swat4stats.settings"
norecursedirs = ".git"
python_files = "test_*.py"
addopts = "--tb=native --reuse-db"
testpaths = [
"tests",
]
filterwarnings = [
"ignore",
]
[tool.ruff]
line-length = 100
target-version = "py314"
exclude = [
".git",
".mypy_cache",
".ruff_cache",
".pytest_cache",
".ruff_cache",
"static",
"templates",
]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"AIR", # Airflow
"ANN", # flake8-annotations
"CPY", # flake8-copyright
"D", # pydocstyle
"DOC", # pydoclint
"FAST", # FastAPI
"FIX", # flake8-fixme
"NPY", # NumPy-specific rules
"PD", # pandas-vet
"TD", # flake8-todos
"B904" , # Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None`
"COM812", # Trailing comma missing
"DJ001", # Avoid using `null=True` on string-based fields such as CharField
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # Exception must not use an f-string literal, assign to variable first
"ISC001", # The following rules may cause conflicts when used with the formatter: `ISC001`
"PLC0415", # `import` should be at the top-level of a file
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
"TC001", # Move application import X into a type-checking block
"TC002", # Move third-party import X into a type-checking block
"TC003", # Move standard library import X into a type-checking block
"TRY003", # Avoid specifying long messages outside the exception class
"TRY400", # Use `logging.exception` instead of `logging.error`
"UP037", # Remove quotes from type annotation
]
fixable = ["ALL"]
unfixable = []
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
preview = false
future-annotations = true
[tool.ruff.lint.per-file-ignores]
"apps/*/migrations/*.py" = ["ARG001", "E501", "RUF012"]
"tests/factories/*.py" = ["N805", "RUF012"]
"tests/**.py" = ["ARG001", "ARG002", "FBT001", "PLR0913", "PLR0915", "PLR2004", "S101", "S104", "S314", "S324"]
[tool.ruff.lint.flake8-pytest-style]
parametrize-names-type = "csv"
fixture-parentheses = false
mark-parentheses = false
[tool.ruff.lint.flake8-unused-arguments]
ignore-variadic-names = true
[tool.ruff.lint.isort]
force-sort-within-sections = false
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.mypy]
disable_error_code = "misc"
python_version = "3.14"
check_untyped_defs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
ignore_missing_imports = true
strict_equality = true
[[tool.mypy.overrides]]
module = "apps.*.migrations.*"
disable_error_code = "var-annotated, has-type, arg-type"
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = false
[tool.coverage.run]
branch = true
omit = [
"apps/*/migrations/*",
"tests/*",
"apps/*/translation.py",
]
[tool.coverage.report]
include = [
"apps/*",
]