inference icon indicating copy to clipboard operation
inference copied to clipboard

UV Refactor with Docker CPU

Open alexnorell opened this issue 11 months ago • 1 comments

Key Changes

  • Migrated from setup.py to pyproject.toml for 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.py with pyproject.toml for package configuration and dependency management
  • Introduced UV package manager for faster and more reliable dependency installation
  • Removed .isort.cfg and pytest.ini in favor of consolidated config in pyproject.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.toml under optional features

Technical Notes

  • Uses hatchling as 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 avatar Jan 14 '25 17:01 alexnorell

@alexnorell @grzegorz-roboflow what it would take to get this across the line and switch to UV?

hansent avatar Mar 02 '25 22:03 hansent