MCPcopy Create free account
hub / github.com/python/mypy / get_header_deps

Function get_header_deps

mypyc/build.py:569–582  ·  view source on GitHub ↗

Find all the headers used by a group of cfiles. We do this by just regexping the source, which is a bit simpler than properly plumbing the data through. Arguments: cfiles: A list of (file name, file contents) pairs.

(cfiles: list[tuple[str, str]])

Source from the content-addressed store, hash-verified

567
568
569def get_header_deps(cfiles: list[tuple[str, str]]) -> list[str]:
570 """Find all the headers used by a group of cfiles.
571
572 We do this by just regexping the source, which is a bit simpler than
573 properly plumbing the data through.
574
575 Arguments:
576 cfiles: A list of (file name, file contents) pairs.
577 """
578 headers: set[str] = set()
579 for _, contents in cfiles:
580 headers.update(re.findall(r'#include [<"]([^>"]+)[>"]', contents))
581
582 return sorted(headers)
583
584
585def mypyc_build(

Callers 1

mypyc_buildFunction · 0.85

Calls 3

setClass · 0.85
sortedFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…