Skip to content

v4.3.0

Choose a tag to compare

@Kydoimos97 Kydoimos97 released this 14 Aug 04:26
· 89 commits to release since this release

πŸ”§ Major Logging System Refactoring & Import Streamlining

Summary

This PR delivers a comprehensive refactoring of WrenchCL's logging system, replacing the monolithic ccLogBase.py with a modular, SOLID-compliant architecture. Additionally, it streamlines dependency management and improves the developer experience with cleaner imports.

πŸ—οΈ Architecture Changes

Logging System Modernization

  • Replaced ccLogBase.py (2,200+ lines) with modular cLogger.py and supporting services
  • Introduced clean separation of concerns with dedicated service classes:
    • ColorService - Manages color presets and terminal compatibility
    • MessageProcessor - Handles message formatting and markup
    • FormatterFactory - Creates appropriate formatters based on configuration
    • LoggerConfigState - Immutable configuration management
    • GlobalLoggerManager & HandlerManager - Lifecycle management

Import Simplification

  • Standardized logger import: from WrenchCL import logger (was from WrenchCL.Tools.ccLogBase import logger)
  • Eliminated wildcard imports in favor of explicit declarations
  • Updated all module __init__.py files for better organization

πŸ”Œ Dependency Management Improvements

AWS Optional Dependencies

  • Enhanced error messaging when AWS dependencies are missing
  • Moved AWS-specific internals to Connect/_Internal/ for better organization
  • Removed deprecated gate_imports() function in favor of explicit dependency checks
  • Pinned paramiko==3.5.1 for stability

Robust Import Testing

  • Added comprehensive test_optional_imports.py with 300+ lines of tests
  • Validates graceful degradation when optional dependencies are unavailable
  • Ensures core functionality remains accessible regardless of optional packages

πŸ“¦ Project Structure Enhancements

Configuration Updates (pyproject.toml)

  • Reorganized optional dependencies for clarity (aws, color, trace, all)
  • Added maintainer information and comprehensive project URLs
  • Included type stubs for better IDE support
  • Enhanced development dependency management

Documentation Updates

  • Updated all documentation examples to use new import patterns
  • Revised Home.md with current best practices

πŸ§ͺ Testing & Quality Improvements

  • Comprehensive optional import testing covering real-world usage patterns
  • Graceful error handling with helpful user guidance
  • Maintained backward compatibility for existing functionality
  • Applied SOLID principles throughout the codebase

🚫 Removed/Deprecated

  • ❌ ccLogBase.py (replaced by modular system)
  • ❌ require_module.py (replaced by explicit dependency management)
  • ❌ release.sh and Makefile (streamlined development process)

Backward Compatibility

  • βœ… All existing logger functionality preserved
  • βœ… Same API surface for end users
  • βœ… Configuration methods unchanged
  • βœ… AWS services work identically when dependencies are available

🎯 Benefits

  1. Developer Experience: Cleaner imports and better error messages
  2. Maintainability: Modular architecture following SOLID principles
  3. Reliability: Comprehensive testing of optional dependency scenarios
  4. Performance: More efficient formatter and handler management
  5. Extensibility: Clear separation of concerns enables easier feature additions

This refactoring positions WrenchCL for easier maintenance and future enhancements while providing immediate benefits in code clarity and dependency management.