Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

v0.2.1: Type Safety Improvements

Choose a tag to compare

@mi-skam mi-skam released this 11 Dec 04:34
· 9 commits to main since this release

Type Safety Improvements

This release fixes type checking issues in the CLI using Python's TypeGuard feature.

What's Changed

Type System Enhancements:

  • Fixed type inference for CLI parameters (ssh_target, portainer_url, portainer_key)
  • Added is_non_empty_str() TypeGuard function to utils.py
  • Improved compatibility with type checkers (mypy, pyright)
  • Variables now properly narrowed from str | None to str after validation

Implementation Details:

  • TypeGuard-based validation for explicit type narrowing
  • Variables initialized at function scope with proper types
  • Assertions in deployment blocks to satisfy type checkers
  • Removed duplicate variable assignments

Code Quality:

  • Code formatting improvements across multiple files
  • Better type safety without runtime behavior changes
  • Maintains fail-fast validation pattern

Technical Notes

The TypeGuard approach provides explicit type narrowing that works with advanced type checkers while maintaining the existing validation and error handling patterns. This is a non-breaking change that improves developer experience when using type checkers.