This document outlines the plan to migrate the cli-code project from using pip and venv to using uv for environment and package management.
Switching to uv aims to:
- Improve Development Speed: Leverage
uv's significantly faster dependency resolution and installation capabilities compared topip. - Streamline Workflows: Utilize
uv's unified command-line interface for environment creation (uv venv), installation (uv pip install,uv sync), and potentially locking (uv pip compile). - Enhance CI/CD Efficiency: Reduce the time taken for dependency installation steps in the GitHub Actions workflow.
- Align with Modern Tooling: Adopt a actively developed tool from the creators of Ruff.
This migration will be performed on a dedicated feature branch (e.g., feature/uv-migration) following the established development practices.
-
M1: Local Validation & Setup (
feature/uv-migration)- Developers install
uvlocally. - Verify core local workflows:
- Create virtual environment:
uv venv - Install dependencies from
pyproject.tomlfor development:uv pip install -e .[dev](or similar depending on group definitions) - Run linters (Ruff, MyPy).
- Run tests (
pytest).
- Create virtual environment:
- Confirm basic project functionality remains unchanged.
- Document any immediate issues or necessary adjustments.
- Commit initial findings and successful local workflow commands.
- Developers install
-
M2: Update Documentation (
feature/uv-migration)- Modify
README.md: Update installation and setup sections to useuvcommands. - Modify
docs/install.md: Update detailed installation and setup instructions. - Modify
docs/contributing.md: Update development environment setup guide. - Ensure consistency across all documentation referencing environment setup or package installation.
- Commit documentation changes.
- Modify
-
M3: Update CI Workflow (
feature/uv-migration)- Modify
.github/workflows/python-ci.yml:- Add a step to install
uvitself early in the job. - Replace
pip installcommands with equivalentuv pip installoruv synccommands for installing project dependencies and test requirements.
- Add a step to install
- Trigger CI runs and verify all jobs pass successfully using
uv. - Commit CI workflow changes.
- Modify
-
M4: Final Review & Merge (
feature/uv-migration)- Review all project files (scripts, docs, configs) for any lingering
pip-specific commands or references that should be updated or removed. - Consider removing
requirements.txtfiles if they were only used forpipinstallation and locking isn't managed byuv pip compileyet (if applicable). - Perform a final check of local workflows and CI pipeline status.
- Submit Pull Request for review and merge into
main.
- Review all project files (scripts, docs, configs) for any lingering
For this migration:
- Feature Branch: All work will be done on the
feature/uv-migrationbranch. - Small Commits: Use small, logical commits for each milestone step.
- Testing/Linting: Ensure all existing tests and linter checks pass after switching local commands to
uv. - CI Pipeline: The primary goal is to ensure the CI pipeline passes using
uvfor dependency management in M3. - Pull Request: Submit a Pull Request to
mainupon completion of M4.
README.mddocs/install.mddocs/contributing.md.github/workflows/python-ci.yml- (Potentially remove/ignore
requirements*.txtfiles if switching locking mechanism, TBD)
- Lock Files: This plan focuses on replacing
pip installandvenv. We can decide later whether to also replacepip-toolswithuv pip compilefor managing lock files (requirements.txt/.lock). For now,uv pip install -r requirements.txtcan still be used if needed. - Developer Adoption: Ensure all active developers are aware of the switch and update their local environments/workflows.