Skip to content

Conversation

@Ash-Blanc
Copy link

Motivation

Migrate from Poetry to uv package manager for significantly improved performance and reproducibility:

Why uv?

  • 100x faster - uv is written in Rust and dramatically speeds up dependency resolution and installation
  • Deterministic lock files - uv.lock ensures perfect reproducibility across all environments and machines
  • Single binary installation - No complex environment setup or version conflicts unlike Poetry
  • PEP 621 standards - Uses standard Python packaging specifications for better interoperability
  • Modern Python ecosystem - Aligns with tools like Ruff and other modern Python tooling
  • Faster CI/CD - Significantly reduces build times in continuous integration
  • Better contributor experience - Lower friction for onboarding new contributors

Changes

pyproject.toml

  • Convert from [tool.poetry] to [project] section (PEP 621 compliant)
  • Convert dependencies to standard dependencies array format
  • Update build system from poetry-core to hatchling (lighter alternative)
  • Add proper classifiers for package metadata
  • Maintain all existing dependencies and version constraints

README.md

  • Replace poetry install with uv sync for dependency installation
  • Replace poetry run api with uv run api for running scripts

Next steps (can be in follow-up PRs)

  • Delete poetry.lock after generating uv.lock
  • Consider updating CI/CD pipelines to use uv
  • Update any documentation referencing Poetry

Installation instructions for users

# Install uv (one-time setup)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Or via package manager:
# macOS: brew install uv
# Linux: pip install uv (or package manager)

# Install dependencies
uv sync

# Run the API
uv run api

Testing

Please test the following:

  • uv sync successfully installs all dependencies
  • uv run api starts the server correctly
  • python main.py works as expected for development
  • Library import works: pip install . or similar

Convert from Poetry to uv package manager for improved performance and reproducibility:

- Migrate pyproject.toml to PEP 621 standards with uv compatibility
- Convert dependencies to standard format
- Update build system to use hatchling (lighter alternative to poetry-core)
- Add classifiers for better package metadata
- Use uv.lock for deterministic dependency resolution

Benefits:
- 100x faster dependency resolution (uv is written in Rust)
- Deterministic lock files for perfect reproducibility across machines
- Simpler installation (single binary vs Poetry complexity)
- Better alignment with modern Python tooling ecosystem
- Faster CI/CD pipelines and contributor onboarding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant