Skip to content

Commit 8df83e4

Browse files
authored
small fix to gate feature-specific python build behind conditional (#787)
1 parent 8d58648 commit 8df83e4

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

sdkbuild/python.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,16 @@ requires-python = "~=3.10"
120120
if err := executeCommand("uv", "add", "--dev", "mypy"); err != nil {
121121
return nil, fmt.Errorf("failed installing mypy: %w", err)
122122
}
123-
123+
124124
// Create __init__.py files in feature directories to make them proper Python packages
125-
if err := executeCommand("find", "../features", "-type", "d", "-exec", "touch", "{}/__init__.py", ";"); err != nil {
126-
return nil, fmt.Errorf("failed creating __init__.py files: %w", err)
127-
}
128-
129-
if err := executeCommand("uv", "run", "mypy", "--explicit-package-bases", "../features"); err != nil {
130-
return nil, fmt.Errorf("failed type checking: %w", err)
125+
if _, err := os.Stat(filepath.Join(dir, "../features")); err == nil {
126+
if err := executeCommand("find", "../features", "-type", "d", "-exec", "touch", "{}/__init__.py", ";"); err != nil {
127+
return nil, fmt.Errorf("failed creating __init__.py files: %w", err)
128+
}
129+
130+
if err := executeCommand("uv", "run", "mypy", "--explicit-package-bases", "../features"); err != nil {
131+
return nil, fmt.Errorf("failed type checking: %w", err)
132+
}
131133
}
132134

133135
success = true

0 commit comments

Comments
 (0)