- Verify no cyclic dependencies in processor components
- Document dependency management strategies in systemPatterns.md
- Update activeContext.md with current verification status
- Confirm proper use of TYPE_CHECKING and late initialization
Created new shared package with centralized progress tracking:
videoarchiver/shared/progress.py
videoarchiver/shared/init.py
Refactored compression_manager.py to use shared progress module instead of importing from processor
Architecture improvements:
Better separation of concerns
Eliminated cyclic dependencies
Centralized progress tracking
Improved maintainability
core/types.py - Contains shared interfaces and types
queue/types.py - Contains queue-specific types
Components now depend on interfaces rather than concrete implementations
Broke cyclic dependencies:
Removed direct imports between queue_processor.py and manager.py
Removed circular dependencies between core and processor modules
Components now communicate through well-defined interfaces
Improved architecture:
Clear separation of concerns
Better dependency management
More maintainable and testable code
Proper use of dependency injection
Updating queue_processor.py to use the shared types
Updating manager.py to use the correct imports and shared types
The cyclic dependency has been resolved by:
Moving shared types to a separate module
Having queue_processor.py only import from shared modules
Having manager.py use the QueueProcessor from queue/processor.py
Updated base.py to use absolute imports
Updated cleanup.py to use absolute imports
Updated events.py to use absolute imports
Updated error_handler.py to use absolute imports
Updated guild.py to use absolute imports
Updated initialization.py to use absolute imports
Updated lifecycle.py to use absolute imports
Updated response_handler.py to use absolute imports
Updated settings.py to use absolute imports
In the core/commands module:
Updated archiver_commands.py to use absolute imports
Updated database_commands.py to use absolute imports
Updated settings_commands.py to use absolute imports
Left init.py unchanged as its relative imports are appropriate
In the processor module:
Updated core.py to use absolute imports
Updated processor/init.py to use absolute imports
Updated queue_handler.py to use absolute imports
Updated queue_processor.py to use absolute imports
Updated status_display.py to use absolute imports
Updated cleanup_manager.py to use absolute imports
from videoarchiver.utils import progress_tracker
Updated the main init.py to properly handle module reloading:
Added 'videoarchiver.processor' and 'videoarchiver.processor.core' to modules_to_reload
Added explicit import and reload of the processor module
These changes ensure that:
The progress_tracker is properly imported from the utils package
All necessary modules are reloaded during initialization
Circular imports are avoided
The package structure maintains proper dependency flow
Implemented proper singleton pattern in ProgressTracker class
Created shared instance in utils/init.py
Updated all files to use relative imports correctly
Removed duplicate progress_tracker.py from processor/
Fixed circular imports by removing ProgressTracker from processor.py re-exports
- Force reload of all command modules
- Remove modules from sys.modules before importing
- Reload utils module after importing
- Ensure proper exception imports
- Add module reloading to ensure exceptions are available
- Import and re-export all necessary exceptions
- Maintain existing setup and teardown functions
- Add version information
- Update __all__ list with all exports
- Add CommandError and EventError to imports and __all__
- Add CogError to imports and __all__
- Add TrackingError to imports and __all__
- Add helper functions for error handling and progress tracking
- Add version information and shared instances
- Add __all__ list to exceptions.py
- Fix absolute imports to use relative imports
- Fix duplicate imports
- Fix truncated code in download_core.py
- Add missing imports and type hints
- Fix indentation and formatting issues