generated from communitiesuk/funding-service-design-TEMPLATE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
228 lines (196 loc) · 5.89 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
[project]
name = "funding-service-design-post-award-data-store"
version = "0.1.0"
requires-python = ">=3.11, <3.12"
dependencies = [
"boto3==1.36.26",
"celery[redis]==5.4.0",
"cssmin==0.2.0",
"email-validator==2.2.0",
"flask-admin[sqlalchemy]==2.0.0a3",
"flask-assets==2.1.0",
"flask-sqlalchemy==3.0.3",
"flask-talisman==1.1.0",
"flask-wtf==1.2.2",
"flask==3.1.0",
"funding-service-design-utils==6.0.2",
"govuk-frontend-jinja==3.3.0",
"govuk-frontend-wtf==3.1.0",
"greenlet==3.1.1",
"jsmin==3.0.1",
"marshmallow-sqlalchemy==0.29.0",
"notifications-python-client==9.1.0",
"openpyxl==3.1.5",
"pandas==1.5.3",
"pandera==0.17.2",
"psycopg2-binary==2.9.10",
"sentry-sdk==2.20.0",
"sqlalchemy==2.0.9",
"wtforms==3.1.2",
"xlsxwriter==3.2.0",
]
[tool.ruff]
line-length = 120
target-version = "py311"
[tool.ruff.lint]
select = [
"E", # pycodestyle
"W", # pycodestyle
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C90", # mccabe cyclomatic complexity
"G", # flake8-logging-format
]
ignore = []
exclude = [
"db/migrations/versions/",
"venv*",
".venv*",
"__pycache__",
]
mccabe.max-complexity = 12
[tool.mypy]
python_version = "3.11"
# Start off with these
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
# Getting these passing should be easy
strict_equality = true
# Strongly recommend enabling this one as soon as you can
check_untyped_defs = true
# These shouldn't be too much additional work, but may be tricky to
# get passing if you use a lot of untyped libraries
disallow_subclassing_any = false
disallow_untyped_decorators = false
disallow_any_generics = false
# These next few are various gradations of forcing use of type annotations
disallow_untyped_calls = false
disallow_incomplete_defs = false
disallow_untyped_defs = false
# This one isn't too hard to get passing, but return on investment is lower
no_implicit_reexport = false
# This one can be tricky to get passing if you use a lot of untyped libraries
warn_return_any = false
# MyPy just says these are "extra checks that are technically correct but may be inpractical in real code"
# We can try this out and if it's too difficult, we can leave it disabled.
extra_checks = true
# If all of the above options are enabled, we should be able to just turn on `strict` mode
strict = false
[[tool.mypy.overrides]]
module = [
"flask_assets",
"fsd_utils.*",
"notifications_python_client.*",
"flask_wtf.*",
"govuk_frontend_wtf.wtforms_widgets",
"flask_admin.*",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"app.*",
"config.*",
"data_store.*",
"scripts.*",
"tests.*",
"db.*",
]
disable_error_code = ["import-untyped", "name-defined", "attr-defined", "import-not-found", "index"]
[[tool.mypy.overrides]]
module = "data_store/serialisation/data_serialiser"
disable_error_code = ["arg-type"]
[[tool.mypy.overrides]]
module = "data_store/validation/towns_fund/fund_specific_validation/fs_validate_r4"
disable_error_code = ["arg-type"]
# check_untyped_defs enabled exceptions
# we should get rid of these one by one
[[tool.mypy.overrides]]
module = "data_store.celery"
check_untyped_defs = false
[[tool.mypy.overrides]]
module = [
"scripts.re-ingest",
"scripts.batch_ingest",
"scripts.validate",
"scripts.db_filename_clean",
]
check_untyped_defs = false
[[tool.mypy.overrides]]
module = [
"find.main.routes",
"submit.main.routes",
]
check_untyped_defs = false
[[tool.mypy.overrides]]
module = ["data_store.cli"]
check_untyped_defs = false
[[tool.mypy.overrides]]
module = [
"db.migrations.env",
"db.migrations.versions.*"
]
check_untyped_defs = false
[[tool.mypy.overrides]]
module = ["data_store.controllers.admin_tasks"]
check_untyped_defs = false
[[tool.mypy.overrides]]
module = ["data_store.metrics"]
check_untyped_defs = false
[[tool.mypy.overrides]]
module = ["admin.actions"]
check_untyped_defs = false
[[tool.mypy.overrides]]
module = [
"tests.find_tests.test_routes",
"tests.find_tests.test_date_conversions",
"tests.submit_tests.test_fund",
"tests.integration_tests.test_ingest_db_transactions",
"tests.data_store_tests.test_full_pf_pipeline",
"tests.data_store_tests.db_tests.test_queries",
"tests.data_store_tests.controller_tests.test_mappings",
"tests.data_store_tests.controller_tests.test_failed_submission",
"tests.data_store_tests.messaging_tests.test_messaging",
"tests.data_store_tests.messaging_tests.test_tf_messaging",
"tests.data_store_tests.serialisation_tests.test_serialisation",
"tests.data_store_tests.transformation_tests.test_transformation_utils",
"tests.data_store_tests.transformation_tests.towns_fund.test_tf_transform_r3",
"tests.data_store_tests.validation_tests.towns_fund.schema_validation_tests.test_casting",
"tests.data_store_tests.validation_tests.towns_fund.schema_validation_tests.test_validate",
]
check_untyped_defs = false
[tool.uv]
[dependency-groups]
dev = [
"boto3-stubs[logs,s3]==1.36.26",
"debugpy==1.8.12",
"flask-debugtoolbar==0.16.0",
"freezegun==1.5.1",
"mypy==1.14.1",
"pandas-stubs==1.5.3.230321",
"pre-commit==4.1.0",
"pydot==1.4.2",
"pytest==8.3.4",
"pytest-cov==6.0.0",
"pytest-env==0.8.2",
"pytest-mock==3.14.0",
"pytest-playwright==0.6.2",
"requests-mock==1.12.1",
"ruff==0.9.3",
"types-beautifulsoup4==4.12.0.20250204",
"types-colorama==0.4.15.20240311",
"types-flask==1.1.6",
"types-flask-migrate==4.1.0.20250112",
"types-jmespath==1.0.2.20240106",
"types-openpyxl==3.1.5.20241225",
"types-psycopg2==2.9.21.20250121",
"types-pygments==2.19.0.20250219",
"types-pymysql==1.1.0.20241103",
"types-python-dateutil==2.9.0.20241206",
"types-pyyaml==6.0.12.20241230",
"types-requests==2.32.0.20241016",
"types-setuptools==70.3.0.20240710",
"types-wtforms==3.2.1.20241221",
"watchfiles==1.0.4",
]