Skip to content

build: migrate from poetry to uv#30

Merged
FelixAbrahamsson merged 2 commits into
masterfrom
uv-migration
Jul 1, 2026
Merged

build: migrate from poetry to uv#30
FelixAbrahamsson merged 2 commits into
masterfrom
uv-migration

Conversation

@FelixAbrahamsson

Copy link
Copy Markdown
Contributor

Migrates the project from Poetry to uv.

Changes

  • pyproject.toml: converted to PEP 621. pytorch-lantern is a published PyPI library, so the build backend is now uv_build. The import package lantern/ lives at the repo root (flat layout, was packages=[{include="lantern"}]), so [tool.uv.build-backend] sets module-root = "" and module-name = "lantern". Removed the leftover [tool.poetry] table.
  • Lockfile: poetry.lock -> uv.lock (101 packages, uv lock --check passes).
  • CI (test.yml, publish.yml): install uv via astral-sh/setup-uv (cached), poetry install -> uv sync --locked, poetry run -> uv run, poetry build -> uv build, and poetry publish -> uv publish (PyPI token via UV_PUBLISH_*). The unrelated pip-based build-docs job is unchanged.

Validation

  • uv lock --check: passes.
  • Tests: uv sync --locked --extra training + pytest -> 33 passed.
  • Build: uv build produces a wheel containing the lantern/ package.
  • No Dockerfiles in this repo. No private index dependencies (publishes to public PyPI).

🤖 Generated with Claude Code

Convert to PEP 621 pyproject with uv. Library published to PyPI: switch
build backend to uv_build (flat layout, module-name = "lantern",
module-root = ""). Replace poetry.lock with uv.lock and migrate the
test/publish CI workflows to uv.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@FelixAbrahamsson FelixAbrahamsson marked this pull request as ready for review July 1, 2026 12:16
GitHub now hard-fails `actions/cache@v2` at the action-download step, which
was breaking the pip-based build-docs job (pre-existing on master, not the
uv migration). Bump the deprecated pins across both workflows:
actions/cache v2 -> v4, actions/checkout v2 -> v4, actions/setup-python
v2 -> v5.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@FelixAbrahamsson FelixAbrahamsson merged commit ba3f419 into master Jul 1, 2026
3 checks passed
@FelixAbrahamsson FelixAbrahamsson deleted the uv-migration branch July 1, 2026 12:24
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