-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpyproject.toml
148 lines (132 loc) · 3.8 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
[tool.poetry]
name = "swat4stats"
version = "0.106.0"
description = "Source code to swat4stats.com backend"
authors = ["Sergei Khoroshilov <[email protected]>"]
license = "MIT"
readme = "README.md"
package-mode = false
[tool.poetry.dependencies]
python = "^3.12,<3.13"
Django = "5.1.4"
celery = "5.4.0"
bleach = "6.2.0"
pytz = "2024.2"
Markdown = "3.7"
psycopg = {extras = ["binary"], version = "3.2.3"}
redis = "5.2.1"
uWSGI = "2.0.28"
python-dateutil = "2.9.0.post0"
ipwhois = "1.3.0"
django-cacheback = "3.0.0"
django-debug-toolbar = "4.4.6"
django-countries = "7.6.1"
django-filter = "24.3"
djangorestframework = "3.15.2"
voluptuous = "0.15.2"
aiohttp = "3.11.11"
django-redis = "5.4.0"
sentry-sdk = "2.19.2"
[tool.poetry.group.dev.dependencies]
coverage = "7.6.10"
Faker = "33.3.0"
factory-boy = "3.3.1"
pytest = "8.3.4"
pytest-django = "4.9.0"
pytest-localserver = "0.9.0.post0"
pytest-cov = "6.0.0"
pytest-repeat = "0.9.3"
mypy = "1.14.1"
types-pytz = "2024.2.0.20241221"
ruff = "0.8.6" # also update the version in github workflows and .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 = "py312"
exclude = [
".git",
".mypy_cache",
".ruff_cache",
".pytest_cache",
".ruff_cache",
"static",
"templates",
]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"D", # pydocstyle
"ANN", # flake8-annotations
"CPY", # flake8-copyright
"TD", # flake8-todos
"FIX", # flake8-fixme
"PD", # pandas-vet
"NPY", # NumPy-specific rules
"FAST", # FastAPI
"AIR", # Airflow
"DOC", # pydoclint
"COM812", # Trailing comma missing
"TRY003", # Avoid specifying long messages outside the exception class
"TRY400", # Use `logging.exception` instead of `logging.error`
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
"ISC001", # The following rules may cause conflicts when used with the formatter: `ISC001`
"B904" , # Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None`
"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
"DJ001", # Avoid using `null=True` on string-based fields such as CharField
]
fixable = ["ALL"]
unfixable = []
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[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.12"
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/*",
]