Release v1.4.1
This release fixes a critical SSH connection lifecycle bug, introduces ruff for code linting, and includes various code quality improvements.
Bug Fixes
- Fixed SSH connection double-close bug by centralizing lifecycle management in
execute()instead ofexecute_command(), ensuring proper coordination between streaming and separate output modes. - Fixed redundant logic in tab expansion for cleaner code execution.
Features
- Added
ruffas code linter with import organization (isort compatibility) and Pyflakes rules for better code quality. - Added
scripts/lint-check-and-fix.shfor automated linting, import reorganization, and code fixing.
Enhancements
- Updated
stream_command_outputto use theLINESconstant instead of hardcoded1000for better maintainability. - Updated package dependencies for continued compatibility and security.
Code Quality
- Applied code formatting using black (v26.3.0) for improved consistency.
- Applied ruff linting with import sorting and Pyflakes rules across the codebase.
- Reorganized imports throughout the project for better consistency and PEP 8 compliance.
- Updated test files to follow consistent import ordering and structure.
Testing
- Updated 5
execute_commandtests to verify connection close is not called (moved toexecute()). - Added 4 new tests for connection cleanup in
execute()covering separate output, streaming, timeout handling, and already-closed connections. - Fixed mock setup in async tests to avoid RuntimeWarning on async methods.