-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
193 lines (172 loc) · 4.74 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
[tool.poetry]
name = "magnet-sgsi"
version = "2023.04"
description = "The project template for Django 4.2. This project aims to provide a common starting point for Magnet projects."
authors = ["Magnet DPT Team <dpt@magnet.cl>"]
license = "MIT"
[tool.poetry.dependencies]
python = "~3.10"
# semver packages
django = "~4.2"
psycopg = "~3.1"
celery = { version = "~5.2", extras = ["redis"] }
gunicorn = "~20.1.0"
django-celery-beat = "~2.5.0"
django-loginas = "0.3.11"
djangorestframework = "3.14.0"
boto3 = "1.34.10"
ipdb = "0.13.13"
ipython = "~8.19"
Faker = "14.2.0"
cryptography = "~41.0"
django-vite = "~3.0.1"
pyyaml = "~6.0.1"
social-auth-app-django = "~5.4.1"
# non-semver packages (or no information found)
django-debug-toolbar = "4.2.0"
django-extensions = "3.2.3"
python-json-logger = "2.0.7"
django-storages = "1.14.2"
django-redis = "5.4.0"
djangorestframework-camel-case = "1.4.2"
inflection = "0.5.1"
django-xff = "1.4.0"
requests = "2.30.0"
django-recaptcha = "^4.0.0"
# calver packages that must be updated always
pytz = ">=2022.2"
pytest-lazy-fixture = "^0.6.3"
[tool.poetry.group.dev.dependencies]
# semver packages
ruff = "0.1.5"
pytest = "7.2.1"
pytest-celery = "^0.0.0"
pytest-cov = "4.0.0"
pytest-django = "4.5.2"
pytest-dotenv = "~0.5.2"
pytest-lazy-fixture = "^0.6.3"
python-dotenv = "~1.0.1"
pre-commit = "2.21.0"
watchdog = "2.2.1"
Werkzeug = "2.2.3"
django-stubs = "~4.2"
djangorestframework-stubs = "~3.14"
black = "22.12.0"
djlint = "1.34.1"
# calver packages
[tool.poetry.group.deploy-tools]
optional = true
[tool.poetry.group.deploy-tools.dependencies]
ansible-core = "2.15.5"
yq = "2.14.0"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.pytest.ini_options]
required_plugins = "pytest-django"
DJANGO_SETTINGS_MODULE = "project.test_settings"
addopts = [
"-v",
"--cov",
"--tb=native",
"--junit-xml=test-results/pytest.xml",
"--cov-report=html:test-results/pytest",
"--cov-report=term"
]
python_files = [
"tests.py",
"test_*.py",
"*_tests.py"
]
junit_family = "xunit2"
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
]
[tool.coverage.report]
fail_under = 90
sort = "-Cover"
[tool.coverage.run]
omit = [
"*/management/*",
"*/migrations/*",
"*/test/*",
"*/tests/*",
"*/tests.py",
"*/test_*.py",
"*/*_tests.py",
"*/fixtures.py",
"dummy_app/*",
"project/test_settings.py",
"project/settings.py",
"project/urls.py",
"project/logging.py",
".vscode-server"
]
[tool.ruff]
target-version = "py310"
select = ["S", "DTZ", "PGH", "E", "F", "W", "C90", "N", "UP", "BLE", "B", "A", "COM", "C4", "T10", "DJ", "EM", "ISC", "ICN", "PIE", "T20", "Q", "RET", "SIM", "ERA", "PL", "PLC", "PLE", "PLR", "PLW", "TRY", "RUF", "I"]
ignore = ["RUF012", "COM812", "FBT", "G", "INP", "PYI", "PT", "RSE", "SLF", "TID", "TCH", "INT", "ARG", "PTH", "PD", "NPY"]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C", "D", "E", "F", "G", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT", "I"]
unfixable = ["ERA"]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
# Same as Black.
line-length = 88
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.ruff.per-file-ignores]
"**/migrations/*.py" = ["E501", "N"]
"**/tests.py" = [
"S101", # asserts allowed in tests...
"ARG", # Unused function args -> fixtures nevertheless are functionally relevant...
"FBT", # Don't care about booleans as positional arguments in tests, e.g. via @pytest.mark.parametrize()
"PLR0913", # Too many parameters
"PLR2004", # Magic value used in comparison, ...
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
]
"**/tests/**/*.py" = [
"S101",
"ARG",
"FBT",
"PLR0913",
"PLR2004",
"S311",
]
[tool.ruff.isort]
force-single-line = true
lines-between-types = 1
section-order = ["future", "standard-library", "django", "third-party", "first-party", "local-folder"]
[tool.ruff.isort.sections]
django = ["django"]
[tool.django-stubs]
django_settings_module = "project.settings"
[tool.djlint]
indent = 2
max_blank_lines = 1
profile = "django"
ignore = "H030,H031"