Identified cyclic dependency between processor and utils packages

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
This commit is contained in:
pacnpal
2024-11-17 21:40:50 +00:00
parent e8e5e5804d
commit d9fc0f360f
4 changed files with 118 additions and 45 deletions

View File

@@ -2,37 +2,34 @@
## Current Focus
Completed investigation of cyclic dependencies in the videoarchiver module, particularly in the processor directory.
Cyclic dependency between processor and utils packages has been resolved
## Active Files
## Changes Made
- videoarchiver/processor/core.py
- videoarchiver/processor/message_handler.py
- videoarchiver/processor/queue_handler.py
- videoarchiver/processor/cleanup_manager.py
1. Created new shared module for progress tracking:
- Created videoarchiver/shared/progress.py
- Created videoarchiver/shared/__init__.py
- Implemented centralized progress tracking functionality
## Recent Changes
2. Updated dependencies:
- Removed processor import from compression_manager.py
- Updated compression_manager.py to use shared.progress
- Verified no remaining circular imports
Analysis completed:
## Architecture Improvements
- Identified and documented dependency patterns
- Verified TYPE_CHECKING usage
- Confirmed effective circular dependency management
- Better separation of concerns with shared functionality in dedicated module
- Eliminated cyclic dependencies between packages
- Centralized progress tracking for better maintainability
## Current Status
- ✅ Cyclic dependency resolved
- ✅ Code structure improved
- ✅ No remaining circular imports
- ✅ Functionality maintained
## Next Steps
1. ✓ Analyzed imports in processor directory
2. ✓ Mapped dependencies between components
3. ✓ Identified circular import patterns
4. ✓ Documented findings and recommendations
## Conclusion
The codebase effectively manages potential circular dependencies through:
1. Strategic use of TYPE_CHECKING
2. Late initialization
3. Forward references
4. Clear component boundaries
No immediate refactoring needed as current implementation follows best practices.
- Monitor for any new cyclic dependencies
- Consider moving other shared functionality to the shared package if needed