Skip to content

chore: migrate repo from poetry to uv#1589

Merged
hassiebp merged 3 commits intomainfrom
codex/migrate-poetry-to-uv
Mar 30, 2026
Merged

chore: migrate repo from poetry to uv#1589
hassiebp merged 3 commits intomainfrom
codex/migrate-poetry-to-uv

Conversation

@hassiebp
Copy link
Copy Markdown
Contributor

@hassiebp hassiebp commented Mar 30, 2026

Summary

  • migrate project metadata and locking from Poetry to uv with uv_build
  • replace the duplicated langfuse/version.py file with metadata-driven package version lookup
  • switch local tooling, pre-commit hooks, CI, release automation, and Dependabot to uv workflows

Why

This removes Poetry-specific tooling from local development and CI/CD, standardizes the project on uv, and aligns packaging, locking, versioning, and publishing around a single toolchain.

Developer impact

  • use uv sync instead of poetry install
  • use uv run ... for linting, type checking, tests, docs, and pre-commit
  • docs dependencies stay opt-in via uv run --group docs ...
  • release automation now uses uv version, uv build --no-sources, and uv publish

Notes

  • openai remains out of published package metadata and is still a separately installed integration dependency
  • the PR removes poetry.lock, adds uv.lock, and updates Dependabot to the uv ecosystem
  • the new pre-commit config intentionally excludes generated langfuse/api files from Ruff hooks to match the repo's existing lint policy

Validation

  • uv lock
  • uv sync
  • uv run --frozen ruff check .
  • uv run --frozen mypy langfuse --no-error-summary
  • uv run --frozen pytest tests/test_version.py -q
  • uv build --no-sources
  • wheel smoke test via uv run --isolated --no-project --with dist/*.whl ...
  • sdist smoke test via uv run --isolated --no-project --with dist/*.tar.gz ...
  • uv run --frozen pre-commit run --all-files

Residual note

  • importing the package on Python 3.14 still emits the existing Pydantic v1 compatibility warning from langfuse/api/core/pydantic_utilities.py; this migration leaves that behavior unchanged

Disclaimer: Experimental PR review

Greptile Summary

This PR migrates the Langfuse Python SDK from Poetry to uv across all tooling layers: project metadata, lock file, CI workflows, release automation, pre-commit hooks, and developer documentation. It also replaces the hardcoded langfuse/version.py with a metadata-driven langfuse/_version.py using importlib.metadata. One P2 concern was raised about the release workflow leaving uv.lock stale after a version bump.

Confidence Score: 4/5

Clean migration with one uncertain failure mode in the release workflow around stale uv.lock

All functional changes are correct. The sole concern is the release workflow leaving uv.lock stale after a version bump, which could break uv sync --locked in CI on post-release main commits depending on uv's behavior for editable installs.

release.yml — version-bump and commit steps that omit uv.lock

Important Files Changed

Filename Overview
.github/workflows/release.yml Release workflow fully rewritten for uv — versioning, building, and publishing look correct, but uv.lock is not updated/committed after the version bump.
langfuse/_version.py New private module replacing the hardcoded version.py; uses importlib.metadata with an lru_cache fallback — clean and correct.
pyproject.toml Migrated from Poetry to standard [project] table with uv_build backend; dependency specs are equivalent.
.github/workflows/ci.yml All CI jobs migrated to astral-sh/setup-uv@v7 with pinned uv 0.11.2; looks correct.
.pre-commit-config.yaml Switched to uv-pre-commit local hooks; langfuse/api/ exclusion is intentional.
tests/test_version.py New test validates the metadata-driven version approach correctly.

Reviews (1): Last reviewed commit: "migrate repo from poetry to uv" | Re-trigger Greptile

@hassiebp hassiebp changed the title [codex] migrate repo from poetry to uv chore: migrate repo from poetry to uv Mar 30, 2026
@hassiebp hassiebp marked this pull request as ready for review March 30, 2026 14:25
@github-actions
Copy link
Copy Markdown

@claude review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c15573752a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@hassiebp hassiebp merged commit 31d513d into main Mar 30, 2026
12 of 13 checks passed
@hassiebp hassiebp deleted the codex/migrate-poetry-to-uv branch March 30, 2026 16:40
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