From 405135b4588b25616a2a1f68c1a5472924b0fcc6 Mon Sep 17 00:00:00 2001 From: huangruiteng <14976749+huangruiteng@users.noreply.github.com> Date: Thu, 17 Sep 2026 09:23:49 +0800 Subject: [PATCH] test(extensions): give the entrypoint smoke the repository import bootstrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `examples/extension-entrypoint-surface-smoke.py` imported `loopx.extensions…` at module scope without adding the repository root to `sys.path`, which 204 of the 320 public smokes do. When the public smoke sweep runs a smoke with an interpreter that has no installed `loopx` on `sys.path`, as the CI job does, the check dies at import with `ModuleNotFoundError: No module named 'loopx'` and has failed on every `main` run since it landed in #4509. Reproduced with an interpreter that hides site-packages: `python -S examples/extension-entrypoint-surface-smoke.py` fails with the same error before this change and prints `extension-entrypoint-surface-smoke: ok` (9 manifests, 11 entrypoints, 0 unresolved) after it. The script keeps its single `ROOT` definition and moves it above the guarded import. Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com> --- examples/extension-entrypoint-surface-smoke.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/extension-entrypoint-surface-smoke.py b/examples/extension-entrypoint-surface-smoke.py index 9bd2b775db..310bf104ad 100644 --- a/examples/extension-entrypoint-surface-smoke.py +++ b/examples/extension-entrypoint-surface-smoke.py @@ -11,17 +11,20 @@ from __future__ import annotations +import sys from pathlib import Path -from loopx.extensions.entrypoint_surface import ( +ROOT = Path(__file__).resolve().parents[1] +if str(ROOT) not in sys.path: + sys.path.insert(0, str(ROOT)) + +from loopx.extensions.entrypoint_surface import ( # noqa: E402 EntrypointKind, render_report, resolve_declared_entrypoints, ) -ROOT = Path(__file__).resolve().parents[1] - EXPECTED_KINDS = frozenset(kind.value for kind in EntrypointKind) REQUIRED_KINDS = (