A single source for stub: can be a Python or C module. A simple extension of BuildSource that also carries the AST and the value of __all__ detected at runtime.
| 238 | |
| 239 | |
| 240 | class StubSource: |
| 241 | """A single source for stub: can be a Python or C module. |
| 242 | |
| 243 | A simple extension of BuildSource that also carries the AST and |
| 244 | the value of __all__ detected at runtime. |
| 245 | """ |
| 246 | |
| 247 | def __init__( |
| 248 | self, module: str, path: str | None = None, runtime_all: list[str] | None = None |
| 249 | ) -> None: |
| 250 | self.source = BuildSource(path, module, None) |
| 251 | self.runtime_all = runtime_all |
| 252 | self.ast: MypyFile | None = None |
| 253 | |
| 254 | def __repr__(self) -> str: |
| 255 | return f"StubSource({self.source})" |
| 256 | |
| 257 | @property |
| 258 | def module(self) -> str: |
| 259 | return self.source.module |
| 260 | |
| 261 | @property |
| 262 | def path(self) -> str | None: |
| 263 | return self.source.path |
| 264 | |
| 265 | |
| 266 | # What was generated previously in the stub file. We keep track of these to generate |
no outgoing calls
no test coverage detected
searching dependent graphs…