-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
306 lines (290 loc) · 8.53 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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0"]
[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
'^\s*\.\.\.\s*$',
'^\s*pass\s*$',
'^\s*raise NotImplementedError\s*$',
]
[tool.coverage.run]
branch = true
relative_files = true
source = ["api", "core", "scripts"]
[tool.isort]
known_first_party = ["api", "core", "customlists"]
profile = "black"
[tool.mypy]
# TODO: Enable the the check_untyped_defs option
# This will get rid of the warnings that we get when running mypy
# > note: By default the bodies of untyped functions are not checked
# However this currently causes a number of errors to surface that will
# need to be cleaned up before we can enable the option.
# check_untyped_defs = true
# When we enable this option, we should remove this disable. Its just here
# to silence the noise in the mypy output for now, so its easier to see when
# there are errors in the output.
disable_error_code = "annotation-unchecked"
exclude = [
'core/bin/repair/startup\.py',
'core/classifier',
'integration_tests/',
# TODO: Post test-suite refactoring.,
'tests/core/test_external_search\.py',
'tests/core/test_scripts\.py',
]
files = ["."]
plugins = ["pydantic.mypy", "sqlalchemy.ext.mypy.plugin"]
warn_redundant_casts = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[[tool.mypy.overrides]]
# In our tests, we often overwrite methods on classes to mock out behavior.
# This is a common pattern in Python, but mypy doesn't like it. This override
# silences those errors, but only for the tests module.
# See discussion here:
# https://github.com/python/mypy/issues/2427
disable_error_code = "method-assign"
module = "tests.*"
[[tool.mypy.overrides]]
# This override is the equivalent of running mypy with the --strict flag.
# This is a work in progress, but we should try to get as many of our files
# into the module list here as possible.
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
module = [
"api.admin.announcement_list_validator",
"api.admin.config",
"api.admin.controller.catalog_services",
"api.admin.controller.collection_settings",
"api.admin.controller.discovery_service_library_registrations",
"api.admin.controller.discovery_services",
"api.admin.controller.integration_settings",
"api.admin.controller.library_settings",
"api.admin.controller.metadata_services",
"api.admin.controller.patron_auth_services",
"api.admin.dashboard_stats",
"api.admin.form_data",
"api.admin.model.dashboard_statistics",
"api.adobe_vendor_id",
"api.axis",
"api.circulation",
"api.controller.marc",
"api.discovery.*",
"api.enki",
"api.integration.*",
"api.lcp.hash",
"api.marc",
"api.metadata.*",
"api.odl",
"api.odl2",
"api.opds_for_distributors",
"core.feed.*",
"core.integration.*",
"core.marc",
"core.migration.*",
"core.model.announcements",
"core.model.collection",
"core.model.hassessioncache",
"core.model.integration",
"core.model.library",
"core.opds2_import",
"core.opds_import",
"core.selftest",
"core.service.*",
"core.settings.*",
"core.util.authentication_for_opds",
"core.util.base64",
"core.util.cache",
"core.util.log",
"core.util.notifications",
"core.util.problem_detail",
"core.util.string_helpers",
"core.util.uuid",
"core.util.worker_pools",
"core.util.xmlparser",
"tests.fixtures.authenticator",
"tests.fixtures.webserver",
"tests.migration.*",
]
no_implicit_reexport = true
strict_concatenate = true
strict_equality = true
warn_return_any = true
warn_unused_ignores = true
[[tool.mypy.overrides]]
# This override silences errors for modules in our own codebase that we import
# from other covered modules. Ideally we will be able to remove this override
# eventually, once we have type hints for all of our own code.
follow_imports = "silent"
module = [
"core.classifier.*",
]
[[tool.mypy.overrides]]
# This override silences errors for modules we import that don't currently
# have type hints, or type stubs that cover them. We should go through this
# list periodically and remove modules that have since added type hints.
ignore_missing_imports = true
module = [
"aws_xray_sdk.ext.*",
# This is ignored because the file is created when building a container
# so it typically doesn't exist when running mypy, but since it only
# contains a couple version strings it can be safely ignored
"core._version",
"expiringdict",
"feedparser",
"firebase_admin.*",
"flask_babel",
"flask_pydantic_spec.*",
"fuzzywuzzy",
"google.auth",
"greenlet",
"html_sanitizer",
"isbnlib",
"jwcrypto",
"lxml.*",
"money",
"multipledispatch",
"nameparser",
"onelogin.saml2.*",
"opensearch_dsl.*",
"pyfakefs.*",
"pyld",
"pymarc.*",
"pyparsing",
"spellchecker",
"textblob.*",
"unicodecsv",
"uritemplate",
"watchtower",
"wcag_contrast_ratio",
"webpub_manifest_parser.*",
]
[tool.poetry]
authors = ["E-kirjasto"]
description = "E-kirjasto Circulation Manager Application"
homepage = "https://kansalliskirjasto.fi"
license = "Apache-2.0"
name = "E-kirjasto Circulation Manager"
readme = "README.md"
repository = "https://github.com/NatLibFi/ekirjasto-circulation"
version = "0" # Version number is managed with tags in git
[tool.poetry.dependencies]
alembic = {extras = ["tz"], version = "^1.8.1"}
aws-xray-sdk = "~2.12"
bcrypt = "^4.0.1"
boto3 = "^1.28"
certifi = "*"
click = "^8.1.3"
contextlib2 = "21.6.0"
dependency-injector = "^4.41"
expiringdict = "1.2.2"
feedparser = "6.0.11"
firebase-admin = "^6.0.1"
Flask = "^3.0"
Flask-Babel = "^4.0"
Flask-Cors = "4.0.1"
flask-pydantic-spec = "^0.6.0"
fuzzywuzzy = "0.18.0" # fuzzywuzzy is for author name manipulations
html-sanitizer = "^2.1.0"
isbnlib = "^3.10.14"
itsdangerous = "^2.1.2"
jwcrypto = "^1.4.2"
levenshtein = "^0.24"
lxml = "^4.9.3"
money = "1.3.0"
multipledispatch = "^1.0"
nameparser = "^1.1" # nameparser is for author name manipulations
nltk = "3.8.1" # nltk is a textblob dependency.
openpyxl = "3.1.2" # Finland
opensearch-dsl = "~1.0"
opensearch-py = "~1.1"
palace-webpub-manifest-parser = "^3.1.1"
pillow = "^10.0"
pycryptodome = "^3.18"
pydantic = {version = "^1.10.9", extras = ["dotenv", "email"]}
pyinstrument = "^4.6"
PyJWT = "^2.8"
PyLD = "2.0.3"
pymarc = "5.1.1"
pyOpenSSL = "^24.0.0"
pyparsing = "3.1.1"
pyspellchecker = "0.8.1"
python = ">=3.10,<4"
python-dateutil = "2.8.2"
python3-saml = "^1.16" # python-saml is required for SAML authentication
pytz = "^2023.3"
pyyaml = "^6.0"
redmail = "^0.6.0"
requests = "^2.29"
sqlalchemy = {version = "^1.4", extras = ["mypy"]}
textblob = "0.17.1"
types-pyopenssl = "^24.0.0.20240130"
types-pyyaml = "^6.0.12.9"
# We import typing_extensions, so we can use new annotation features.
# - Self (Python 3.11)
typing_extensions = {version = "^4.5.0", python = "<3.11"}
unicodecsv = "0.14.1" # this is used, but can probably be removed on py3
uritemplate = "4.1.1"
urllib3 = "^1.26.19"
uWSGI = "~2.0.21"
watchtower = "3.0.1" # watchtower is for Cloudwatch logging integration
wcag-contrast-ratio = "0.9"
Werkzeug = "^3.0.3"
[tool.poetry.group.ci.dependencies]
dunamai = "^1.16"
pre-commit = "^3.2"
tox = "^4.4"
tox-docker = "^4.1"
tox-gh-actions = "^3.0"
[tool.poetry.group.dev.dependencies]
boto3-stubs = {version = "^1.28", extras = ["boto3", "essential", "logs", "s3"]}
freezegun = "~1.4.0"
Jinja2 = "^3.1.2"
mypy = "^1.4.1"
psycopg2-binary = "~2.9.5"
pyfakefs = "^5.3"
pytest = ">=7.2.0"
pytest-alembic = "^0.10.4"
pytest-cov = "^4.0.0"
pytest-timeout = "*"
requests-mock = "1.11.0"
types-aws-xray-sdk = "^2.11.0.13"
types-Flask-Cors = "^4.0.0"
types-jsonschema = "^4.17.0.5"
types-openpyxl = "^3.1.0.20240205"
types-Pillow = "^10.0.0"
types-psycopg2 = "^2.9.21"
types-python-dateutil = "^2.8.19"
types-pytz = "^2023.2"
types-requests = "^2.28.11"
[tool.poetry.group.pg]
optional = true
[tool.poetry.group.pg.dependencies]
psycopg2 = "~2.9.5"
[tool.pytest.ini_options]
addopts = [
"--cov",
"--cov-report=xml",
"--strict-markers",
]
markers = [
"minio: mark test as requiring minio",
"opensearch: mark test as requiring opensearch",
]
timeout = "600"
timeout_method = "thread"
[tool.tomlsort]
ignore_case = true
in_place = true
sort_inline_arrays = true
sort_table_keys = true
spaces_before_inline_comment = 2
spaces_indent_inline_array = 4
trailing_comma_inline_array = true