-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
472 lines (421 loc) · 11.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
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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools",
"setuptools-scm[toml]==8.1.0",
"wheel",
]
[project]
name = "vws-python-mock"
description = "A mock for the Vuforia Web Services (VWS) API."
readme = { file = "README.rst", content-type = "text/x-rst" }
keywords = [
"client",
"fake",
"mock",
"vuforia",
"vws",
]
license = { file = "LICENSE" }
authors = [
{ name = "Adam Dangoor", email = "[email protected]" },
]
requires-python = ">=3.12"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Pytest",
"License :: OSI Approved :: MIT License",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
]
dynamic = [
"version",
]
dependencies = [
"beartype",
"flask",
"numpy",
"pillow",
"piq",
"pydantic-settings>=2.6.1",
"requests",
"responses",
"torch",
"torchmetrics",
"tzdata; sys_platform=='win32'",
"vws-auth-tools",
"werkzeug",
]
optional-dependencies.dev = [
"actionlint-py==1.7.4.20",
"check-manifest==0.50",
"check-wheel-contents==0.6.1",
"deptry==0.21.1",
"dirty-equals==0.8.0",
"doc8==1.1.1",
"doccmd==2024.11.14",
"docformatter==1.7.5",
"docker==7.1.0",
"enum-tools[sphinx]==0.12.0",
"freezegun==1.5.1",
"furo==2024.8.6",
"interrogate==1.7.0",
"mypy[faster-cache]==1.13.0",
"pre-commit==4.0.1",
"pydocstyle==6.3",
"pyenchant==3.3.0rc1",
"pylint==3.3.2",
"pylint-per-file-ignores==1.3.2",
"pyproject-fmt==2.5.0",
"pyright==1.1.390",
"pyroma==4.2",
"pytest==8.3.4",
"pytest-cov==6.0.0",
"pytest-retry==1.6.3",
"pytest-xdist==3.6.1",
"python-dotenv==1.0.1",
"pyyaml==6.0.2",
"requests-mock-flask==2024.8.30.1",
"ruff==0.8.2",
# We add shellcheck-py not only for shell scripts and shell code blocks,
# but also because having it installed means that ``actionlint-py`` will
# use it to lint shell commands in GitHub workflow files.
"shellcheck-py==0.10.0.1",
"shfmt-py==3.7.0.1",
"sphinx==8.1.3",
"sphinx-copybutton==0.5.2",
"sphinx-paramlinks==0.6",
"sphinx-substitution-extensions==2024.10.17",
"sphinx-toolbox==3.8.1",
"sphinxcontrib-httpdomain==1.8.1",
"sphinxcontrib-spelling==8",
"sybil==9.0.0",
"tenacity==9.0.0",
"types-docker==7.1.0.20240827",
"types-pyyaml==6.0.12.20240917",
"types-requests==2.32.0.20241016",
"urllib3==2.2.3",
"vulture==2.13",
"vws-python==2024.9.21",
"vws-test-fixtures==2023.3.5",
"vws-web-tools==2024.10.6.1",
"yamlfix==1.17.0",
]
optional-dependencies.release = [ "check-wheel-contents==0.6.1" ]
urls.Documentation = "https://vws-python-mock.readthedocs.io"
urls.Source = "https://github.com/VWS-Python/vws-python-mock"
[tool.setuptools]
zip-safe = false
[tool.setuptools.packages.find]
where = [
"src",
]
[tool.setuptools.package-data]
mock_vws = [
"py.typed",
]
[tool.distutils.bdist_wheel]
universal = true
[tool.setuptools_scm]
# We use a fallback version like
# https://github.com/pypa/setuptools_scm/issues/77 so that we do not
# error in the Docker build stage of the release pipeline.
#
# This must be a PEP 440 compliant version.
fallback_version = "0.0.0"
# This keeps the start of the version the same as the last release.
# This is useful for our documentation to include e.g. binary links
# to the latest released binary.
#
# Code to match this is in ``conf.py``.
version_scheme = "post-release"
[tool.ruff]
target-version = "py311"
line-length = 79
lint.select = [
"ALL",
]
lint.ignore = [
# Ruff warns that this conflicts with the formatter.
"COM812",
# Allow our chosen docstring line-style - no one-line summary.
"D200",
"D205",
"D212",
"D415",
# Ruff warns that this conflicts with the formatter.
"ISC001",
# Ignore "too-many-*" errors as they seem to get in the way more than
# helping.
"PLR0913",
# Allow 'assert' in tests as it is the standard for pytest.
# Also, allow 'assert' in other code as it is the standard for Python type hint
# narrowing - see
# https://mypy.readthedocs.io/en/stable/type_narrowing.html#type-narrowing-expressions.
"S101",
]
lint.per-file-ignores."tests/**" = [
# Allow possible hardcoded passwords in tests.
"S105",
"S106",
]
# Do not automatically remove commented out code.
# We comment out code during development, and with VSCode auto-save, this code
# is sometimes annoyingly removed.
lint.unfixable = [
"ERA001",
]
lint.pydocstyle.convention = "google"
[tool.pylint]
[tool.pylint.'MASTER']
# Pickle collected data for later comparisons.
persistent = true
# Use multiple processes to speed up Pylint.
jobs = 0
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
# See https://chezsoi.org/lucas/blog/pylint-strict-base-configuration.html.
# We do not use the plugins:
# - pylint.extensions.code_style
# - pylint.extensions.magic_value
# - pylint.extensions.while_used
# as they seemed to get in the way.
load-plugins = [
"pylint_per_file_ignores",
'pylint.extensions.bad_builtin',
'pylint.extensions.comparison_placement',
'pylint.extensions.consider_refactoring_into_while_condition',
'pylint.extensions.docparams',
'pylint.extensions.dunder',
'pylint.extensions.eq_without_hash',
'pylint.extensions.for_any_all',
'pylint.extensions.mccabe',
'pylint.extensions.no_self_use',
'pylint.extensions.overlapping_exceptions',
'pylint.extensions.private_import',
'pylint.extensions.redefined_loop_name',
'pylint.extensions.redefined_variable_type',
'pylint.extensions.set_membership',
'pylint.extensions.typing',
]
# This format is described in the following issue:
# https://github.com/christopherpickering/pylint-per-file-ignores/issues/160
#
# We ignore invalid names because:
# - We want to use generated module names, which may not be valid, but are never seen.
# - We want to use global variables in documentation, which may not be uppercase
per-file-ignores = """
docs/:invalid-name
doccmd_README_rst.*.py:invalid-name
"""
[tool.pylint.'MESSAGES CONTROL']
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once). See also the "--disable" option for examples.
enable = [
'bad-inline-option',
'deprecated-pragma',
'file-ignored',
'spelling',
'use-symbolic-message-instead',
'useless-suppression',
]
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable = [
# Style issues that we can deal with ourselves
'too-few-public-methods',
'too-many-locals',
'too-many-arguments',
'too-many-instance-attributes',
'too-many-lines',
'locally-disabled',
# Let ruff handle long lines
'line-too-long',
# Let ruff handle unused imports
'unused-import',
# Let ruff deal with sorting
'ungrouped-imports',
# We don't need everything to be documented because of mypy
'missing-type-doc',
'missing-return-type-doc',
# Too difficult to please
'duplicate-code',
# Let ruff handle imports
'wrong-import-order',
]
[tool.pylint.'FORMAT']
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt = false
[tool.pylint.'SPELLING']
# Spelling dictionary name. Available dictionaries: none. To make it working
# install python-enchant package.
spelling-dict = 'en_US'
# A path to a file that contains private dictionary; one word per line.
spelling-private-dict-file = 'spelling_private_dict.txt'
# Tells whether to store unknown words to indicated private dictionary in
# --spelling-private-dict-file option instead of raising a message.
spelling-store-unknown-words = 'no'
[tool.docformatter]
make-summary-multi-line = true
[tool.check-manifest]
ignore = [
".checkmake-config.ini",
".yamlfmt",
"*.enc",
"admin/**",
"readthedocs.yaml",
"CHANGELOG.rst",
"CODE_OF_CONDUCT.rst",
"CONTRIBUTING.rst",
"LICENSE",
"Makefile",
"ci",
"ci/**",
"codecov.yaml",
"docs",
"docs/**",
".git_archival.txt",
"spelling_private_dict.txt",
"tests",
"tests/**",
"vuforia_secrets.env.example",
"lint.mk",
"src/mock_vws/_flask_server/Dockerfile",
"secrets.tar.gpg",
]
[tool.deptry]
pep621_dev_dependency_groups = [
"dev",
"release",
]
[tool.deptry.per_rule_ignores]
DEP002 = [
# tzdata is needed on Windows for zoneinfo to work.
# See https://docs.python.org/3/library/zoneinfo.html#data-sources.
"tzdata",
]
[tool.pyproject-fmt]
indent = 4
keep_full_version = true
max_supported_python = "3.12"
[tool.pytest.ini_options]
xfail_strict = true
log_cli = true
addopts = [
"--strict-markers",
]
markers = [
"requires_docker_build",
]
# Options for pytest-retry.
retries = 10
retry_delay = 10
cumulative_timing = false
[tool.coverage.run]
branch = true
omit = [
"src/mock_vws/_flask_server/healthcheck.py",
]
[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
]
[tool.mypy]
strict = true
files = [ "." ]
exclude = [ "build" ]
plugins = [
"pydantic.mypy",
]
[tool.pyright]
reportUnnecessaryTypeIgnoreComment = true
typeCheckingMode = "strict"
[tool.interrogate]
fail-under = 100
omit-covered-files = true
verbose = 2
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
warn_untyped_fields = true
[tool.doc8]
max_line_length = 2000
ignore_path = [
"./.eggs",
"./docs/build",
"./docs/build/spelling/output.txt",
"./node_modules",
"./src/*.egg-info/",
"./src/*/_setuptools_scm_version.txt",
]
[tool.vulture]
# Ideally we would limit the paths to the source code where we want to ignore names,
# but Vulture does not enable this.
ignore_names = [
# pytest configuration
"pytest_collect_file",
"pytest_collection_modifyitems",
"pytest_plugins",
"pytest_set_filtered_exceptions",
"pytest_addoption",
# pytest fixtures - we name fixtures like this for this purpose
"fixture_*",
# Sphinx
"autoclass_content",
"autoclass_content",
"autodoc_member_order",
"copybutton_exclude",
"extensions",
"html_show_copyright",
"html_show_sourcelink",
"html_show_sphinx",
"html_theme",
"html_theme_options",
"html_title",
"htmlhelp_basename",
"intersphinx_mapping",
"language",
"linkcheck_ignore",
"linkcheck_retries",
"master_doc",
"nitpicky",
"project_copyright",
"pygments_style",
"rst_prolog",
"source_suffix",
"spelling_word_list_filename",
"templates_path",
"warning_is_error",
# Too difficult to test (see notes in the code)
"DATE_RANGE_ERROR",
"REQUEST_QUOTA_REACHED",
# pydantic-settings
"model_config",
]
# Duplicate some of .gitignore
exclude = [ ".venv" ]
ignore_decorators = [
"@pytest.fixture",
# Flask
"@*APP.route",
"@*APP.before_request",
"@*APP.errorhandler",
]
[tool.yamlfix]
section_whitelines = 1
whitelines = 1