From 033cd9fe7f9b2a67f399aa866e314fa54b6c8013 Mon Sep 17 00:00:00 2001 From: Thomas Hardy Date: Tue, 24 Mar 2026 12:38:18 -0700 Subject: [PATCH] small fix to gate feature-specific python build behind conditional --- sdkbuild/python.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sdkbuild/python.go b/sdkbuild/python.go index 6147112e..67c4d0a0 100644 --- a/sdkbuild/python.go +++ b/sdkbuild/python.go @@ -120,14 +120,16 @@ requires-python = "~=3.10" if err := executeCommand("uv", "add", "--dev", "mypy"); err != nil { return nil, fmt.Errorf("failed installing mypy: %w", err) } - + // Create __init__.py files in feature directories to make them proper Python packages - if err := executeCommand("find", "../features", "-type", "d", "-exec", "touch", "{}/__init__.py", ";"); err != nil { - return nil, fmt.Errorf("failed creating __init__.py files: %w", err) - } - - if err := executeCommand("uv", "run", "mypy", "--explicit-package-bases", "../features"); err != nil { - return nil, fmt.Errorf("failed type checking: %w", err) + if _, err := os.Stat(filepath.Join(dir, "../features")); err == nil { + if err := executeCommand("find", "../features", "-type", "d", "-exec", "touch", "{}/__init__.py", ";"); err != nil { + return nil, fmt.Errorf("failed creating __init__.py files: %w", err) + } + + if err := executeCommand("uv", "run", "mypy", "--explicit-package-bases", "../features"); err != nil { + return nil, fmt.Errorf("failed type checking: %w", err) + } } success = true