This repository was archived by the owner on Dec 18, 2025. It is now read-only.
Repository navigation
v0.2.1: Type Safety Improvements
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 toutils.py - Improved compatibility with type checkers (mypy, pyright)
- Variables now properly narrowed from
str | Nonetostrafter 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.