-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
538 lines (515 loc) · 15.4 KB
/
pyproject.toml
File metadata and controls
538 lines (515 loc) · 15.4 KB
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
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools",
"setuptools-scm>=8.1.0",
]
[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 = "MIT"
authors = [
{ name = "Adam Dangoor", email = "adamdangoor@gmail.com" },
]
requires-python = ">=3.14"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Pytest",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.14",
]
dynamic = [
"version",
]
dependencies = [
"beartype>=0.22.9",
"flask>=3.0.3",
"httpx>=0.27.0",
"numpy>=1.26.4",
"pillow>=11.0.0",
"piq>=0.8.0",
"pydantic-settings>=2.6.1",
"requests>=2.32.3",
"responses>=0.25.3",
"respx>=0.21.0",
"torch>=2.5.1",
"torchmetrics>=1.5.1",
"torchvision>=0.20.1",
"tzdata; sys_platform=='win32'",
"vws-auth-tools>=2024.7.12",
"werkzeug>=3.1.2",
]
optional-dependencies.dev = [
"actionlint-py==1.7.12.24",
"check-manifest==0.51",
"check-wheel-contents==0.6.3",
"coverage==7.14.1",
"deptry==0.25.1",
"dirty-equals==0.11",
"doc8==2.0.0",
"doccmd==2026.5.25",
"docker==7.1.0",
"freezegun==1.5.5",
"furo==2025.12.19",
"interrogate==1.7.0",
"mypy[faster-cache]==2.1.0",
"mypy-strict-kwargs==2026.5.20.1",
"prek==0.4.3",
"pydocstringformatter==0.7.5",
"pydocstyle==6.3",
"pylint[spelling]==4.0.5",
"pylint-per-file-ignores==3.2.1",
"pyproject-fmt==2.23.0",
"pyrefly==1.0.0",
"pyright==1.1.410",
"pyroma==5.0.1",
"pytest==9.0.3",
"pytest-beartype-tests==2026.4.26",
"pytest-retry==1.7.0",
"pytest-xdist==3.8.0",
"pyyaml==6.0.3",
"requests-mock-flask==2026.4.2",
"ruff==0.15.15",
# 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.11.0.1",
"shfmt-py==4.0.0",
"sphinx==9.1.0",
"sphinx-copybutton==0.5.2",
"sphinx-lint==1.0.2",
"sphinx-paramlinks==0.6",
"sphinx-pyproject==0.3.0",
"sphinx-substitution-extensions==2026.1.12",
"sphinx-toolbox==4.2.0",
"sphinxcontrib-httpdomain==2.0.0",
"sphinxcontrib-spelling==8.0.2",
# ``sphinxcontrib-towncrier`` renders unreleased news fragments
# into docs/source/unreleased.rst during Sphinx builds.
"sphinxcontrib-towncrier==0.5.0a0",
"strict-kwargs==2026.5.20",
"sybil==10.0.1",
"tenacity==9.1.4",
"towncrier==25.8.0",
"ty==0.0.43",
"types-docker==7.1.0.20260518",
"types-pyyaml==6.0.12.20260518",
"types-requests==2.33.0.20260518",
"urllib3==2.7.0",
"vulture==2.16",
"vws-python==2026.2.25.1",
"vws-test-fixtures==2023.3.5",
"vws-web-tools==2026.5.21",
"yamlfix==1.19.1",
"zizmor==1.25.2",
]
optional-dependencies.release = [ "check-wheel-contents==0.6.3", "towncrier==25.8.0" ]
urls.Documentation = "https://vws-python.github.io/vws-python-mock/"
urls.Source = "https://github.com/VWS-Python/vws-python-mock"
[dependency-groups]
dev = []
[tool.setuptools]
packages.find.where = [
"src",
]
package-data.mock_vws = [
"py.typed",
]
zip-safe = false
[tool.distutils]
bdist_wheel.universal = true
[tool.setuptools_scm]
# 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"
# 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"
[tool.uv]
sources.torch = { index = "pytorch-cpu" }
sources.torchvision = { index = "pytorch-cpu" }
index = [ { name = "pytorch-cpu", url = "https://download.pytorch.org/whl/cpu", explicit = true } ]
[tool.ruff]
line-length = 79
lint.select = [
"ALL",
]
lint.ignore = [
# Ruff warns that this conflicts with the formatter.
"COM812",
# Allow our chosen docstring line-style - pydocstringformatter handles formatting
# but doesn't enforce D205 (blank line after summary) or D212 (summary on first line).
"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",
# Beartype requires imports to be available at runtime, not just for type
# checking. See https://github.com/beartype/beartype/discussions/594
# for when beartype will support `if TYPE_CHECKING` imports.
"TC001",
"TC002",
"TC003",
]
lint.per-file-ignores."ci/test_custom_linters.py" = [
# Allow asserts in tests.
"S101",
]
lint.per-file-ignores."doccmd_*.py" = [
# Allow our chosen docstring line-style - pydocstringformatter handles
# formatting but docstrings in docs may not match this style.
"D200",
# Allow asserts in docs.
"S101",
]
lint.per-file-ignores."tests/**" = [
# Allow asserts in tests.
"S101",
# 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.flake8-tidy-imports.banned-api."typing.cast".msg = "typing.cast is banned: use explicit type narrowing or a typed variable instead."
lint.pydocstyle.convention = "google"
[tool.pylint]
# 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"
"MESSAGES CONTROL".disable = [
# Too difficult to please
"duplicate-code",
# Let ruff handle long lines
"line-too-long",
"locally-disabled",
"missing-return-type-doc",
# We don't need everything to be documented because of mypy
"missing-type-doc",
# Style issues that we can deal with ourselves
"too-few-public-methods",
"too-many-arguments",
"too-many-instance-attributes",
"too-many-lines",
"too-many-locals",
# Let ruff deal with sorting
"ungrouped-imports",
# Let ruff handle unused imports
"unused-import",
# Let ruff handle imports
"wrong-import-order",
]
# 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.
"MESSAGES CONTROL".enable = [
"bad-inline-option",
"deprecated-pragma",
"file-ignored",
"spelling",
"use-symbolic-message-instead",
"useless-suppression",
]
DEPRECATED_BUILTINS.bad-functions = [
# Use Pylint until Ruff can ban bare builtin calls, or until custom rules
# make this removable:
# https://github.com/astral-sh/ruff/issues/10079
# https://github.com/astral-sh/ruff/issues/970
"filter",
"getattr",
"hasattr",
"map",
"setattr",
]
# Allow the body of an if to be on the same line as the test if there is no
# else.
FORMAT.single-line-if-stmt = false
# Return non-zero exit code if useless-suppression is emitted.
MAIN.fail-on = [
"useless-suppression",
]
# Use multiple processes to speed up Pylint.
MASTER.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.
MASTER.load-plugins = [
"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",
"pylint_per_file_ignores",
]
# 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
MASTER.per-file-ignores = [
"docs/source/conf.py:invalid-name",
"docs/source/doccmd_*.py:invalid-name",
"doccmd_README_rst_*.py:invalid-name",
]
# Pickle collected data for later comparisons.
MASTER.persistent = true
MASTER.unsafe-load-any-extension = false
# Spelling dictionary name. Available dictionaries: none. To make it working
# install python-enchant package.
SPELLING.spelling-dict = "en_US"
# A path to a file that contains private dictionary; one word per line.
SPELLING.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.spelling-store-unknown-words = "no"
[tool.interrogate]
fail-under = 100
verbose = 2
omit-covered-files = true
[tool.check-manifest]
ignore = [
"*.enc",
".checkmake-config.ini",
".git_archival.txt",
".prettierrc",
".yamlfmt",
"admin/**",
"CHANGELOG.rst",
"ci",
"ci/**",
"CODE_OF_CONDUCT.rst",
"CONTRIBUTING.rst",
"docs",
"docs/**",
"LICENSE",
"lint.mk",
"Makefile",
"newsfragments",
"newsfragments/**",
"secrets.tar.gpg",
"spelling_private_dict.txt",
"src/mock_vws/_flask_server/Dockerfile",
"tests",
"tests/**",
"vuforia_secrets.env.example",
]
[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",
# torchvision is used transitively via piq, but must be a direct dependency
# so that tool.uv.sources can route it to the CPU-only PyTorch index.
"torchvision",
]
optional_dependencies_dev_groups = [
"dev",
"release",
]
[tool.vulture]
# Duplicate some of .gitignore
exclude = [ ".venv" ]
# Ideally we would limit the paths to the source code where we want to ignore names,
# but Vulture does not enable this.
ignore_names = [
# Sphinx
"autoclass_content",
"autoclass_content",
"autodoc_member_order",
"autodoc_use_legacy_class_based",
# Used in TYPE_CHECKING for type hints
"CloudDatabaseDict",
"copybutton_exclude",
"DatabaseDict",
# Too difficult to test (see notes in the code)
"DATE_RANGE_ERROR",
"extensions",
# pytest fixtures - we name fixtures like this for this purpose
"fixture_*",
"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",
# pydantic-settings
"model_config",
"nitpicky",
"project_copyright",
"pygments_style",
"pytest_addoption",
# pytest configuration
"pytest_collect_file",
"pytest_collection_modifyitems",
"pytest_itemcollected",
"pytest_plugins",
"pytest_set_filtered_exceptions",
"REQUEST_QUOTA_REACHED",
"rst_prolog",
"source_suffix",
"spelling_word_list_filename",
"templates_path",
"towncrier_draft_autoversion_mode",
"towncrier_draft_include_empty",
"towncrier_draft_working_directory",
"VuMarkDatabaseDict",
"VuMarkTargetDict",
"warning_is_error",
]
ignore_decorators = [
"@*APP.after_request",
"@*APP.before_request",
"@*APP.errorhandler",
# Flask
"@*APP.route",
"@pytest.fixture",
"@route",
]
[tool.pyproject-fmt]
indent = 4
keep_full_version = true
max_supported_python = "3.14"
[tool.mypy]
files = [ "." ]
exclude = [ "build" ]
follow_untyped_imports = true
strict = true
plugins = [
"pydantic.mypy",
"mypy_strict_kwargs",
]
[tool.pyrefly]
search_path = [
".",
"src",
]
errors.non-exhaustive-match = "error"
[tool.pyright]
typeCheckingMode = "strict"
enableTypeIgnoreComments = false
reportUnnecessaryTypeIgnoreComment = true
[tool.pytest]
addopts = [
"--strict-markers",
]
cumulative_timing = false
log_cli = true
markers = [
"requires_docker_build",
]
# Options for pytest-retry.
retries = "10"
retry_delay = "10"
xfail_strict = true
[tool.coverage]
run.branch = true
run.omit = [
"src/mock_vws/_flask_server/healthcheck.py",
]
run.parallel = true
run.patch = [ "subprocess" ]
run.relative_files = true
run.source = [ "ci/", "src/", "tests/" ]
report.exclude_also = [
"case _ as unreachable:\n\\s*assert_never\\(",
"class .*\\bProtocol\\):",
"if TYPE_CHECKING:",
]
report.fail_under = 100
report.show_missing = true
[tool.towncrier]
# The changelog and the per-release GitHub release notes are both built
# from news fragments under ``newsfragments/``. The release workflow
# runs ``towncrier build`` to assemble them; contributors add one
# fragment file per user-facing change.
directory = "newsfragments"
filename = "CHANGELOG.rst"
# Custom template so an assembled version reproduces the historical
# style exactly: a bare ``<version>`` heading (no project name, no
# date) followed by a flat bullet list with no per-type sub-headings.
template = "docs/towncrier_template.rst.jinja"
title_format = "{version}"
issue_format = "#{issue}"
# ``title_format`` underline first, then any nested headings. A bare
# version such as ``2026.05.18`` underlined with ``-`` matches every
# pre-towncrier entry in CHANGELOG.rst.
underlines = [ "-", "~", "^" ]
type = [
# A single, unnamed fragment type keeps the assembled output as one
# flat bullet list, matching the historical changelog (which never
# grouped entries under "Features"/"Bugfixes"/... sub-headings).
{ directory = "change", name = "", showcontent = true },
]
[tool.pydocstringformatter]
write = true
split-summary-body = false
max-line-length = 75
linewrap-full-docstring = true
[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.yamlfix]
section_whitelines = 1
whitelines = 1