-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
175 lines (149 loc) · 4.1 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
[tool.poetry]
name = "cms"
version = "0.1.0"
description = "The Wagtail CMS for managing and publishing content for the Office for National Statistics (ONS)"
authors = ["ONSdigital"]
license = "MIT"
readme = "README.md"
package-mode = false
[tool.poetry.dependencies]
python = "^3.12"
django = "~5.1.2"
wagtail = "~6.2.2"
dj-database-url = "~2.3.0"
django-basic-auth-ip-whitelist = "~0.6"
django-csp = "~3.8"
django-defender = "~0.9.8"
django-extensions = "~3.2"
django-jinja = "^2.11.0"
django-redis = "~5.4"
django-storages = { version = "~1.14", extras = ["s3"] }
gunicorn = "~23.0"
psycopg = "~3.2.3"
sentry-sdk = "~2.17"
wagtail-font-awesome-svg = "^1.0.1"
apscheduler = "^3.10.4"
wagtail-storages = "~2.0"
wagtailmath = "~1.3.0"
whitenoise = "~6.8"
[tool.poetry.group.dev.dependencies]
# :TODO: Remove pylint when ruff supports all pylint rules
djhtml = "3.0.7"
mypy = "^1.13.0" # keep version in sync with .pre-commit-config.yaml
django-stubs = { version="^5.1.1", extras=["compatible-mypy"]}
pylint = "^3.3.1"
pylint-django = "^2.0.0"
ruff = "^0.7.1" # keep version in sync with .pre-commit-config.yaml
wagtail-factories = "^4.1.0"
coverage = "^7.6.4"
dslr = "^0.4.0"
django-debug-toolbar = "^4.4.6"
pudb = "^2024.1"
tblib = "^3.0.0"
Werkzeug = "~3.0.6"
setuptools = "^75.2.0"
honcho = "^2.0.0"
detect-secrets = "^1.5.0"
[tool.ruff]
target-version = "py312"
line-length = 120
indent-width = 4
[tool.ruff.lint]
select = [
# Enabling ALL is not recommended it will implicitly enable new rules after upgrade.
# "ALL",
# Ruff rules: https://docs.astral.sh/ruff/rules/
"E", # pycodestyle erros
"W", # pycodestyle warnings
"F", # Pyflakes
"UP", # pyupgrade
"I", # isort
"B", # flake8-bugbear
"SIM", # flake8-simplify
"C4", # flake8-comprehensions
"S", # flake8-bandit
"D", # pydocstyle - Enforce existing docstrings only
"C90", # mccabe
"RUF", # Ruff specific rules
# PL - Pylint is only partially supported, we also use the pylint tool to catch all the rules.
# It is enabled here to take advantage of the ruff's speed.
"PL",
]
ignore = [
# Conflicts with google docstring style
"D205",
# Allow missing docstring, remove to enforce docstrings across the board
"D100", "D101", "D102", "D103", "D104", "D105", "D106", "D107",
# indentation contains tabs
"W191",
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"**/tests/*" = [
# Allow use of assert statements in tests
"S101",
]
"cms/*/migrations/*" = [
"RUF012"
]
"cms/settings/*.py" = ["SIM105"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.mypy]
# Global mypy options
no_implicit_optional = "True"
ignore_missing_imports = "True"
warn_unused_configs = "True"
warn_no_return = "False"
warn_unused_ignores = "True"
warn_return_any = "True"
warn_redundant_casts = "True"
disallow_untyped_defs = "True"
disallow_untyped_calls = "True"
disallow_incomplete_defs = "True"
strict_equality = "True"
plugins = "mypy_django_plugin.main"
[[tool.mypy.overrides]]
module = "*.migrations.*"
ignore_errors = true
[[tool.mypy.overrides]]
module = "*.tests.*"
ignore_errors = true
[tool.django-stubs]
django_settings_module = "cms.settings.test"
[tool.coverage.run]
source = ["cms"]
omit = [
"manage.py",
"conftest.py",
"*venv/*",
"*.mypy_cache*",
"**/node_modules/*",
"**/migrations/*",
"**/tests/*",
]
parallel = true
concurrency = ["multiprocessing", "thread"]
[tool.coverage.report]
show_missing = true
skip_covered = true
exclude_also = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain about missing debug-only code:
"def __repr__",
"if self.debug",
"if settings.DEBUG",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",
# Nor complain about type checking
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]