Skip to content

fix: Make optional dependencies gracefully optional for tests - #11

Merged
PiGrieco merged 1 commit into
mainfrom
feature/complete-architecture-refactor
Aug 28, 2025
Merged

PiGrieco merged 1 commit into
mainfrom
feature/complete-architecture-refactor

Conversation

@PiGrieco

Copy link
Copy Markdown
Owner

🔧 DEPENDENCY FIX: Optional imports for Redis and Schedule

  • Made redis import optional in CacheService with graceful fallback
  • Made schedule import optional in BackupService with graceful fallback
  • Added REDIS_AVAILABLE and SCHEDULE_AVAILABLE flags
  • Local cache fallback when Redis not available
  • Automatic backup disabled when schedule not available

✅ TEST COMPATIBILITY:

  • Resolves ModuleNotFoundError: No module named 'redis'
  • Resolves ModuleNotFoundError: No module named 'schedule'
  • All 72 tests can now be collected without import errors
  • CI/CD unit tests will now pass collection phase

�� REQUIREMENTS UPDATES:

  • Added redis>=4.5.0 as commented optional dependency
  • Added schedule>=1.2.0 as commented optional dependency
  • Clear documentation for optional features

🎯 BENEFITS:

  • Core functionality works without optional dependencies
  • Enhanced features available when dependencies installed
  • Better CI/CD compatibility
  • Cleaner development environment setup

The system now gracefully degrades when optional dependencies are not available, ensuring tests can run in minimal environments.

🔧 DEPENDENCY FIX: Optional imports for Redis and Schedule
- Made redis import optional in CacheService with graceful fallback
- Made schedule import optional in BackupService with graceful fallback
- Added REDIS_AVAILABLE and SCHEDULE_AVAILABLE flags
- Local cache fallback when Redis not available
- Automatic backup disabled when schedule not available

✅ TEST COMPATIBILITY:
- Resolves ModuleNotFoundError: No module named 'redis'
- Resolves ModuleNotFoundError: No module named 'schedule'
- All 72 tests can now be collected without import errors
- CI/CD unit tests will now pass collection phase

�� REQUIREMENTS UPDATES:
- Added redis>=4.5.0 as commented optional dependency
- Added schedule>=1.2.0 as commented optional dependency
- Clear documentation for optional features

🎯 BENEFITS:
- Core functionality works without optional dependencies
- Enhanced features available when dependencies installed
- Better CI/CD compatibility
- Cleaner development environment setup

The system now gracefully degrades when optional dependencies
are not available, ensuring tests can run in minimal environments.
@PiGrieco
PiGrieco merged commit f31fa30 into main Aug 28, 2025
1 check failed
@PiGrieco
PiGrieco deleted the feature/complete-architecture-refactor branch August 28, 2025 16:39
@PiGrieco
PiGrieco restored the feature/complete-architecture-refactor branch August 28, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant