[CI] Stop the resolution ratchets re-parsing the whole package (#36235)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
effe0d14d2
commit
1ec20fd25d
@@ -689,13 +689,14 @@ class TestForksResolveFirst(CustomTestCase):
|
|||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
source = path.read_text(encoding="utf-8-sig")
|
source = path.read_text(encoding="utf-8-sig")
|
||||||
|
if "Process" not in source:
|
||||||
|
continue
|
||||||
tree = ast.parse(source)
|
tree = ast.parse(source)
|
||||||
except (SyntaxError, UnicodeDecodeError):
|
except (SyntaxError, UnicodeDecodeError):
|
||||||
continue
|
continue
|
||||||
for node in ast.walk(tree):
|
for node in ast.walk(tree):
|
||||||
if not isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)):
|
if not isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)):
|
||||||
continue
|
continue
|
||||||
body = ast.get_source_segment(source, node) or ""
|
|
||||||
forks = [
|
forks = [
|
||||||
call
|
call
|
||||||
for call in ast.walk(node)
|
for call in ast.walk(node)
|
||||||
@@ -714,6 +715,7 @@ class TestForksResolveFirst(CustomTestCase):
|
|||||||
]
|
]
|
||||||
if not forks:
|
if not forks:
|
||||||
continue
|
continue
|
||||||
|
body = ast.get_source_segment(source, node) or ""
|
||||||
examined += 1
|
examined += 1
|
||||||
# `spawn` starts a fresh interpreter, so the child may probe.
|
# `spawn` starts a fresh interpreter, so the child may probe.
|
||||||
if 'get_context("spawn")' in body or "'spawn'" in body:
|
if 'get_context("spawn")' in body or "'spawn'" in body:
|
||||||
@@ -939,7 +941,10 @@ class TestTheResolutionSeamHasOneCaller(CustomTestCase):
|
|||||||
callers = []
|
callers = []
|
||||||
for path in sorted(package_root.rglob("*.py")):
|
for path in sorted(package_root.rglob("*.py")):
|
||||||
try:
|
try:
|
||||||
tree = ast.parse(path.read_text())
|
source = path.read_text()
|
||||||
|
if "_run_resolution_pipeline" not in source:
|
||||||
|
continue
|
||||||
|
tree = ast.parse(source)
|
||||||
except SyntaxError:
|
except SyntaxError:
|
||||||
continue
|
continue
|
||||||
# The full (class, function, ...) scope chain, so the assertion can
|
# The full (class, function, ...) scope chain, so the assertion can
|
||||||
@@ -988,7 +993,10 @@ class TestTheResolutionSeamHasOneCaller(CustomTestCase):
|
|||||||
callers = []
|
callers = []
|
||||||
for path in sorted(package_root.rglob("*.py")):
|
for path in sorted(package_root.rglob("*.py")):
|
||||||
try:
|
try:
|
||||||
tree = ast.parse(path.read_text())
|
source = path.read_text()
|
||||||
|
if "resolve_once" not in source:
|
||||||
|
continue
|
||||||
|
tree = ast.parse(source)
|
||||||
except SyntaxError:
|
except SyntaxError:
|
||||||
continue
|
continue
|
||||||
for node in ast.walk(tree):
|
for node in ast.walk(tree):
|
||||||
|
|||||||
Reference in New Issue
Block a user