[mypyc] Record MRO ancestor modules as deps of subclass-defining modules (#21743)
Fixes #21742 Mypy's incremental system only recompiles a module when a recorded dependency changes, and a dependency edge to an ancestor's module is created in cases such as an explicit import or a checked expression whose type references that ancestor. A bare subclass definition produces neither, so the transitive ancestors never enter the module's dependency graph. The goal of this PR is to make the dependency graph reflect what the generated C actually depends on. When compiling with mypyc, a module that defines a class now records the modules defining every ancestor in that class's MRO as indirect dependencies, so an ancestor's interface change reaches the subclass-defining module directly.
G
Giorgos Michas committed
3d657d66915fe8b12bebb7ce12a44e5dc59d66f8
Parent: d17b99e
Committed by GitHub <noreply@github.com>
on 7/21/2026, 12:57:20 PM