-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmypy.ini
More file actions
65 lines (57 loc) · 2.54 KB
/
Copy pathmypy.ini
File metadata and controls
65 lines (57 loc) · 2.54 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
[mypy]
# v0.10.5 dep-cycle Phase 1C: explicit_package_bases=True tells
# mypy to treat each top-level wd on the CLI as a separate package
# root for module resolution. Resolves the duplicate-conftest
# module-name collision (apps/api/tests/conftest vs
# libs/gw2_core/tests/conftest become DISTINCT module names).
explicit_package_bases = True
# v0.10.5 dep-cycle Phase 1C-round-2/3/4: mypy_path with both the
# workspace src/ roots AND apps/api/tests so:
# - src-layout workspace libs resolve as their canonical
# top-level modules (gw2_analytics.aggregate, NOT
# libs.gw2_analytics.src.gw2_analytics.aggregate)
# - apps/api/tests/_fixtures resolves as `_fixtures` -- the
# ~13 test files in apps/api/tests/ that ``from _fixtures
# import ...`` resolve as `_fixtures`.
#
# Why libs/*/tests are NOT in mypy_path: adding them WOULD
# resolve libs/gw2_core/tests/conftest.py as `conftest` (same
# name as apps/api/tests/conftest.py from the apps/api/tests/
# entry) and reintroduce the Phase 1C-iteration-1's
# "Duplicate module named 'conftest'" error. Keeping them OUT
# of mypy_path means each libs/<lib>/tests/ file resolves
# relatively via the CLI-wd (`libs`) as `libs.<lib>.tests.X`
# -- a unique module name, no collision.
mypy_path = libs/gw2_analytics/src:libs/gw2_api_client/src:libs/gw2_core/src:libs/gw2_evtc_parser/src:apps/api/src
strict = True
warn_unused_ignores = True
warn_redundant_casts = True
warn_return_any = True
disallow_untyped_defs = True
no_implicit_optional = True
check_untyped_defs = True
python_version = 3.12
plugins = pydantic.mypy
# Files we ignore globally (newline-separated regexes).
exclude = (?x)(\.venv|node_modules|web/|build/|dist/|apps/api/alembic/versions/)
# Tests can have looser typing. v0.10.5 dep-cycle Phase 1C-round-4:
# the grant was previously `[mypy-tests.*]` which only matched a
# bare SHORT module named `tests.X`. Now that all test files
# resolve as their fully-qualified path (`libs.gw2_analytics.
# tests.X`, `apps.api.tests.X`), the matching glob needs to be
# `*.tests.*` so it matches any module with `tests.` in its
# dotted path. This resolves the residual
# `no-untyped-def` error in libs/gw2_analytics/tests/
# test_condi_power_split.py:17 (and preventively any future
# no-untyped-def in apps/api/tests/ or libs/<lib>/tests/).
[mypy-*.tests.*]
disallow_untyped_defs = False
# External libs sometimes lack complete annotations
[mypy-pydantic.*]
ignore_missing_imports = True
[mypy-fastapi_mcp]
ignore_missing_imports = True
[mypy-slowapi]
ignore_missing_imports = True
[mypy-slowapi.*]
ignore_missing_imports = True