Comprehensive automated dependency management for Capcat with intelligent error detection and repair mechanisms.
The refactored dependency management system provides:
scripts/setup_dependencies.py
Comprehensive Python-based dependency manager with:
# Normal setup (auto-detects and fixes issues)
python3 scripts/setup_dependencies.py
# Force complete rebuild
python3 scripts/setup_dependencies.py --force-rebuild
# Validation only (no changes)
python3 scripts/setup_dependencies.py --check-only
# Verbose logging
python3 scripts/setup_dependencies.py --verbose
scripts/fix_dependencies.sh
User-friendly bash wrapper with simple interface:
# Quick fix (most common case)
./scripts/fix_dependencies.sh
# Force complete rebuild
./scripts/fix_dependencies.sh --force
# Check dependencies only
./scripts/fix_dependencies.sh --check
run_capcat.py (refactored)
Integrated into the main Capcat wrapper with:
venv/bin/pip: line 2: /Users/xpro/...: No such file or directory
Virtual environment contains absolute paths from previous location.
./scripts/fix_dependencies.sh --force
Missing dependencies: ['requests', 'beautifulsoup4', ...]
./scripts/fix_dependencies.sh
python3 scripts/setup_dependencies.py --force-rebuild
If automated tools fail, manual setup:
# 1. Remove broken venv
rm -rf venv
# 2. Create fresh venv
python3 -m venv venv
# 3. Activate venv
source venv/bin/activate
# 4. Install dependencies
pip install -r requirements.txt
# 5. Verify installation
python3 scripts/setup_dependencies.py --check-only
The enhanced wrapper (run_capcat.py) automatically:
No user intervention required for normal operation.
The dependency system uses specific exit codes:
0: Success1: General error2: Dependency error (automatic repair failed)3: Execution error130: User interrupted (Ctrl+C)The system validates dependencies by:
python --version from venvEnable detailed logging for diagnostics:
python3 scripts/setup_dependencies.py --verbose --force-rebuild
Validate without making changes:
./scripts/fix_dependencies.sh --check
Check virtual environment health:
# Check venv structure
ls -la venv/bin/
# Test venv Python
venv/bin/python --version
# Check installed packages
venv/bin/pip list
# Inspect pyvenv.cfg
cat venv/pyvenv.cfg
./capcat instead of directly running python capcat.py--check-only to detect issues early--force when moving project to new locationpython3 scripts/setup_dependencies.py --requirements custom-requirements.txt
Cache stored at: venv/.dependency_cache.json
Contains:
# CI pipeline example
python3 scripts/setup_dependencies.py --check-only || \
python3 scripts/setup_dependencies.py --force-rebuild
Planned improvements:
If automated dependency management fails:
--verbose flag for detailed diagnostics