-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmypy.ini
More file actions
217 lines (177 loc) · 7.76 KB
/
mypy.ini
File metadata and controls
217 lines (177 loc) · 7.76 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
[mypy]
python_version = 3.13
warn_return_any = True
warn_unused_ignores = True
ignore_missing_imports = False
namespace_packages = True
explicit_package_bases = True
warn_unused_configs = True
disallow_untyped_defs = False
check_untyped_defs = True
# Only report errors in explicitly passed files, not transitively checked modules
# This still TYPE-CHECKS our usage of imported APIs, just doesn't report
# internal implementation errors within those packages
follow_imports = silent
# Source paths for workspace packages (used for non-Bazel runs)
# Bazel's rules_mypy sets MYPYPATH automatically from target deps
mypy_path = .
# Pydantic plugin for proper type understanding of Field() defaults and aliases
# SQLAlchemy plugin for proper ORM type inference
plugins = pydantic.mypy, sqlalchemy.ext.mypy.plugin
# Exclude only test fixtures and testdata within packages
# Also exclude Alembic migrations (auto-generated boilerplate)
# statsmodels is excluded because it has a broken module structure that causes
# mypy to error with "Source file found twice under different module names"
exclude = /testdata/|/fixtures/|/vendor/|/migrations/|tana/export/references/|/statsmodels/|props/specimens/.*/code/
# Per-module overrides for test data
[mypy-*.testdata.*]
ignore_errors = True
# --- Packages without py.typed and no stubs available ---
# pyrage 1.2.x: Rust extension (age encryption). No py.typed, no stubs.
# Exports are from the compiled .so module.
[mypy-pyrage.*]
ignore_missing_imports = True
# compact_json 1.8.2: pure-Python, no py.typed marker, no types-compact-json stubs.
# Reverify: check if py.typed added in future release.
[mypy-compact_json.*]
ignore_missing_imports = True
# reaktiv 0.21.3: has inline type hints but no py.typed marker file.
# Reverify: check if py.typed added in future release.
[mypy-reaktiv.*]
ignore_missing_imports = True
# pytimeparse 1.1.8: last release 2018, no py.typed, no stubs.
# Reverify: unlikely to change (unmaintained).
[mypy-pytimeparse.*]
ignore_missing_imports = True
# gnucash: Python bindings for GnuCash, no type stubs.
# Used by: finance/gnucash_*.py
[mypy-gnucash.*]
ignore_missing_imports = True
# inventree 0.23.1 (inventree-api): no py.typed, no stubs.
# Used by: inventree_utils/
[mypy-inventree.*]
ignore_missing_imports = True
# google-api-python-client 2.192.0: no py.typed, no stubs.
[mypy-googleapiclient.*]
ignore_missing_imports = True
# --- Packages with broken stubs or internal type errors ---
# PyHamcrest 2.1.0: has py.typed but type annotations are broken —
# all_of()/only_contains() use Union[Matcher[T], T] which mypy infers as
# Matcher[Never]. Skip analysis so imports resolve as Any.
# Upstream fix: https://github.com/hamcrest/PyHamcrest/pull/267
# Reverify: check if PR #267 is released (2.1.1+).
[mypy-hamcrest.*]
follow_imports = skip
ignore_missing_imports = True
# rpds-py 0.30.0: bundled __init__.pyi has implicit Optional parameters
# (e.g. `def get(self, key: K, default: V = ...) -> V` missing `| None`).
# Triggers: error: Incompatible return value type
[mypy-rpds.*]
ignore_errors = True
# pygit2 1.19.1: stubs reference pygit2._libgit2.ffi (CFFI-generated module)
# which has no stubs. Only this specific submodule needs the override.
[mypy-pygit2._libgit2.ffi]
ignore_missing_imports = True
# types-requests stubs import urllib3 internally. In Bazel's rules_mypy stubs
# virtualenv, urllib3 may not be on MYPYPATH for all targets.
[mypy-urllib3.*]
ignore_missing_imports = True
# Legacy inventree import script — uses duck typing patterns (dynamic attribute
# access, untyped dicts) not compatible with strict mypy.
[mypy-import_samplebooks2]
ignore_errors = True
# absl-py 2.x: bundled stubs contain stale `# type: ignore[override]` comments
# that trigger warn_unused_ignores. Internal to the library.
[mypy-absl.*]
ignore_errors = True
# numpy: bundled stubs have internal overload/override conflicts.
# ignore_missing_imports needed because types-networkx stubs import numpy
# in the rules_mypy stubs virtualenv where numpy may not be resolved.
[mypy-numpy.*]
ignore_errors = True
ignore_missing_imports = True
# types-networkx: stubs have stale `# type: ignore[misc]` that should be
# `[overload-overlap]`. Upstream bug in the stubs package.
[mypy-networkx.*]
ignore_errors = True
# docker-py 7.1.0: no py.typed. types-docker stubs exist but have
# import-untyped errors and unused `# type: ignore` comments internally.
[mypy-docker.*]
ignore_missing_imports = True
ignore_errors = True
# statsmodels 0.14.6: broken __init__.py causes mypy to report
# "Source file found twice under different module names". Also excluded
# in the [mypy] exclude regex.
[mypy-statsmodels.*]
ignore_errors = True
# googleapis-common-protos: .pyi stubs reference google.protobuf submodules
# which trigger import-untyped errors even with types-protobuf installed
# (incomplete transitive stubs in Bazel's stubs virtualenv).
[mypy-google.rpc.*]
ignore_errors = True
# zstandard 0.25.0: bundled stubs have ZstdCompressionWriter.write()
# signature returning int vs None incompatibility with IO[bytes] protocol.
[mypy-zstandard.*]
ignore_errors = True
# pyzmq 27.1.0: bundled stubs have import errors (zmq.backend.cython
# references missing C extension stubs) and unused `# type: ignore` comments.
[mypy-zmq.*]
ignore_errors = True
# filelock 3.25.0: has py.typed, but bundled stubs contain stale
# `# type: ignore` comments that trigger warn_unused_ignores.
# Reverify: check if fixed in future release.
[mypy-filelock.*]
ignore_errors = True
# matplotlib 3.10.8: bundled stubs have unused `# type: ignore` comments.
# Large stub surface area — unlikely to be fixed soon.
[mypy-matplotlib.*]
ignore_errors = True
# pandas 3.0.1: bundled stubs have zero-member enum issues
# (e.g. `class NaType(enum.Enum)` with no members triggers mypy errors).
[mypy-pandas.*]
ignore_errors = True
# gatelet: our code — needs SQLAlchemy ORM type annotation refactoring.
# TODO: Add Mapped[] annotations to models and fix Column type narrowing.
[mypy-x.gatelet.*]
ignore_errors = True
# mautrix 0.21.0: bundled stubs have internal type issues
# (e.g. incompatible overrides in EventType, ContentType).
[mypy-mautrix.*]
ignore_errors = True
# --- Infrastructure / internal overrides ---
# Test-local marker modules (pytest markers shared within test directories).
# These are small _markers.py files not on MYPYPATH.
[mypy-_markers]
ignore_missing_imports = True
# rules_python runfiles module: Bazel-provided at runtime, no stubs.
[mypy-rules_python.*]
ignore_missing_imports = True
# props tests have complex relative conftest imports not resolvable by mypy
# (conftest.py files across nested test directories with fixture re-exports).
[mypy-props.core.tests.*]
ignore_errors = True
# tokenizers 0.22.2: Rust extension (HuggingFace). Bundled stubs have
# duplicate class definitions (Tokenizer defined in both __init__.pyi
# and tokenizers.pyi).
[mypy-tokenizers.*]
ignore_errors = True
# opentelemetry-proto: bundled stubs have protobuf Descriptor assignment
# errors (e.g. assigning google.protobuf.descriptor.FileDescriptor to
# DESCRIPTOR field typed as google.protobuf.descriptor.Descriptor).
[mypy-opentelemetry.proto.*]
ignore_errors = True
# cotrl: experimental RL code with many untyped deps (gymnasium, scipy,
# stable-baselines3). Pre-existing, not worth fixing.
[mypy-x.cotrl.*]
ignore_errors = True
# kubernetes-asyncio 35.0.1: stubs reference
# IoK8sApimachineryPkgApisMetaV1GroupVersionKind which doesn't exist in
# kubernetes_asyncio.client.models (upstream bug in code generation).
# Reverify: check if fixed in v36+.
[mypy-kubernetes_asyncio.*]
ignore_errors = True
# logfire-api 4.29.0: stub-only package whose stubs reference
# logfire.propagate, logfire.sampling, structlog.types — modules that
# aren't installed (only logfire-api is in deps, not the full logfire).
[mypy-logfire_api.*]
ignore_errors = True