From 28429d7953ce5d1385b0537bb44ac2d656e87579 Mon Sep 17 00:00:00 2001 From: Shengliang Xu Date: Mon, 14 Sep 2026 16:32:30 +0000 Subject: [PATCH] Add pyrefly config with fallback search path for example imports Add a [tool.pyrefly] section enabling enable-fallback-search-path so pyrefly (the VS Code extension / CLI) resolves example scripts' sibling imports the way Python does at runtime (script dir on sys.path), e.g. examples/hf_ptq/example_utils. Config-only, ignored by anyone without pyrefly; no dependency or CI change. Signed-off-by: Shengliang Xu --- pyproject.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index f23ce722e5c..04f809e2aa5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -373,3 +373,11 @@ exclude_lines = [ # Don't complain about abstract methods, they aren't run "@(abc\\.)?abstractmethod", ] + +[tool.pyrefly] +# Walk up from each importing file's directory to the config root to resolve imports, +# matching how Python puts a script's own directory on sys.path at runtime. This lets +# example scripts that import sibling helper modules next to them (e.g. +# examples/hf_ptq/example_utils, cast_mxfp4_to_nvfp4) type-check without listing each +# example directory in search-path. +enable-fallback-search-path = true