inference
inference copied to clipboard
UV Refactor with Docker CPU
Key Changes
- Migrated from
setup.pytopyproject.tomlfor modern Python package management - Optimized Docker build process with multi-stage builds
- Consolidated and updated dependency management
- Removed redundant configuration files
Details
Package Management
- Replaced
setup.pywithpyproject.tomlfor package configuration and dependency management - Introduced UV package manager for faster and more reliable dependency installation
- Removed
.isort.cfgandpytest.iniin favor of consolidated config inpyproject.toml
Docker Optimization
- Optimized
Dockerfile.onnx.cpu:- Switched to slim Python base image
- Implemented multi-stage build to reduce final image size
- Consolidated ENV variables
- Updated to Python 3.13
Dependency Updates
- Updated and standardized dependency versions across requirements files
- Loosened version constraints on several packages while maintaining compatibility
- Dependencies are now properly categorized in
pyproject.tomlunder optional features
Technical Notes
- Uses
hatchlingas the build backend - Maintains all existing optional dependencies but organizes them better
- Dockerfile now uses UV for more efficient package installation
This change modernizes our Python package management approach and optimizes our container builds while maintaining all existing functionality.
Implementation Details
- Replaced multiple requirements.txt files with pyproject.toml optional dependencies
- Introduced multi-stage Docker build to optimize image size
- Consolidated isort and pytest configurations into pyproject.toml
- Updated dependency constraints to be more flexible while maintaining stability
@alexnorell @grzegorz-roboflow what it would take to get this across the line and switch to UV?