|
38 | 38 | "src/hawkapi/routing/route.py", |
39 | 39 | "src/hawkapi/routing/param_converters.py", |
40 | 40 | "src/hawkapi/middleware/_pipeline.py", |
41 | | - # Added in Wave 3: router registration path (hot at startup, also called |
42 | | - # on include_router) and the plan-based dependency resolver (hot per |
43 | | - # request on every non-trivial route). Both are pure-typed with no |
44 | | - # subclassing constraints from user code, so mypyc can compile them freely. |
45 | | - "src/hawkapi/routing/router.py", |
46 | | - "src/hawkapi/di/resolver.py", |
| 41 | + # NOTE: routing/router.py and di/resolver.py were considered for Wave 3 |
| 42 | + # expansion but are EXCLUDED — mypyc type-checks transitive imports which |
| 43 | + # pull in the entire codebase (including optional deps like structlog, |
| 44 | + # prometheus_client). Keep them interpreted until we have a narrower |
| 45 | + # mypyc invocation that only checks the selected modules. |
47 | 46 | # NOTE: app.py is intentionally EXCLUDED — HawkAPI(Router) is subclassed |
48 | 47 | # by user code and mypyc does not allow interpreted classes to inherit from |
49 | 48 | # compiled ones at runtime. |
@@ -92,6 +91,10 @@ def build_extensions() -> Sequence[Any]: |
92 | 91 | # Import lazily so pure-Python builds never need ``mypy`` installed. |
93 | 92 | from mypyc.build import mypycify # noqa: PLC0415 |
94 | 93 |
|
| 94 | + # Type-check scope is limited via [tool.mypy] in pyproject.toml |
| 95 | + # (follow_imports = silent, ignore_missing_imports = true) so mypy does not |
| 96 | + # walk the whole package when type-checking the compiled modules, and so |
| 97 | + # optional runtime deps absent from build isolation do not fail the build. |
95 | 98 | return mypycify( |
96 | 99 | list(HOT_MODULES), |
97 | 100 | strip_asserts=False, |
|
0 commit comments