fix(python): give folder modules an empty __path__ so relative imports resolve to workspace scripts (#12307)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
hugocasa
2026-11-10 22:54:14 +01:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 949ef234a8
commit 0323310d64
3 changed files with 32 additions and 11 deletions
+21
View File
@@ -38,3 +38,24 @@ def main():
'',
'',
'f/system_relative/nested_script', 12348, 'python3', '');
-- Named after files in the job dir (loader.py) and after the running script's folder (f/system/).
INSERT INTO public.script(workspace_id, created_by, content, schema, summary, description, path, hash, language, lock) VALUES (
'test-workspace',
'test-user',
'from .different_folder_script import main
',
'{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{},"required":[],"type":"object"}',
'',
'',
'f/system_relative/loader', 12349, 'python3', '');
INSERT INTO public.script(workspace_id, created_by, content, schema, summary, description, path, hash, language, lock) VALUES (
'test-workspace',
'test-user',
'from .different_folder_script import main
',
'{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{},"required":[],"type":"object"}',
'',
'',
'f/system_relative/system', 12350, 'python3', '');