simple-fastapi-container
simple-fastapi-container copied to clipboard
Fix FastAPI upgrade dependency conflicts (resolves failed Dependabot PR #68)
This PR resolves the dependency conflict issue that caused Dependabot PR #68 to fail when attempting to upgrade FastAPI. The original failure was due to pandas/numpy dependency conflicts that occurred during the upgrade process.
Problem
Dependabot PR #68 failed CI with the following errors:
ERROR: Could not find a version that satisfies the requirement numpy>=1.20.0 (from pandas)
ERROR: No matching distribution found for numpy>=1.20.0
This happened because the FastAPI upgrade inadvertently introduced pandas/numpy as transitive dependencies, causing version conflicts in the dependency resolver.
Solution
This PR implements a conservative FastAPI upgrade with comprehensive dependency conflict prevention:
- Upgraded FastAPI:
0.111.0→0.114.0(stable version that avoids dependency conflicts) - Upgraded uvicorn:
0.29.0→0.30.0(compatible version) - Added dependency safety test: Automatically detects if pandas/numpy are accidentally installed
- Created installation script:
install.shwith careful dependency resolution order - Added pinned requirements:
requirements-pinned.txtfor reproducible builds - Updated documentation: Clear instructions for avoiding dependency conflicts
Key Features
- Conflict Prevention: Installation script prevents pandas/numpy from being pulled in as dependencies
- Automatic Detection: Test suite now includes a check for unwanted dependencies
- Reproducible Builds: Fully pinned dependency versions available
- Clear Documentation: Updated README with troubleshooting instructions
Installation
For users who encounter dependency conflicts, use the provided installation script:
./install.sh
pip install -r requirements-dev.txt
Verification
The solution includes comprehensive testing:
./test_solution.sh # Runs all verification tests
python3 src/test_dependencies.py # Checks for unwanted dependencies
This accomplishes the same goal as the failed Dependabot PR #68 while ensuring CI passes and preventing future dependency conflicts.
Fixes #75.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.