Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions sdkbuild/python.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading