Skip to content

chore(python-sdk): migrate from Poetry to uv#1513

Open
mishushakov wants to merge 7 commits into
mainfrom
mishushakov/python-poetry-to-uv
Open

chore(python-sdk): migrate from Poetry to uv#1513
mishushakov wants to merge 7 commits into
mainfrom
mishushakov/python-poetry-to-uv

Conversation

@mishushakov

Copy link
Copy Markdown
Member

Migrates the Python SDK's packaging and CI from Poetry to uv: pyproject.toml is converted to PEP 621 metadata using uv's native uv_build backend (verified to produce a byte-equivalent wheel containing both e2b and e2b_connect), poetry.lock is replaced with uv.lock, and the Makefile, package.json scripts, .tool-versions, CLAUDE.md, and all six GitHub workflows now use uv (astral-sh/setup-uv + uv sync/build/version/publish). It also drops the now-redundant explicit sync steps (since uv run auto-syncs) and removes the orphaned pydoc-markdown dev dependency, whose only consumer was deleted long ago — trimming 58 packages from the dev lockfile.

Usage

cd packages/python-sdk
uv sync          # install deps (replaces `poetry install`)
uv run pytest    # run tests
uv build         # build the wheel/sdist
make lint        # ruff (run via `uv run`)

No user-facing SDK change — packaging/tooling only — so no changeset is included; the published package contents are unchanged.

Switch the Python SDK's packaging and CI tooling from Poetry to uv:
convert pyproject.toml to PEP 621 metadata with the native uv_build
backend, replace poetry.lock with uv.lock, and update the Makefile,
package.json scripts, .tool-versions, and all GitHub workflows to use
uv. Also drop the redundant sync steps (uv run auto-syncs) and the
orphaned pydoc-markdown dev dependency.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6bf4589

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cursor

cursor Bot commented Jun 30, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes PyPI publish and CI install/build paths for the Python SDK; runtime library code is untouched, but a misconfigured uv publish or lockfile drift could break releases or CI.

Overview
Migrates Python SDK packaging and tooling from Poetry to uv with no intended change to the published e2b package contents.

pyproject.toml is rewritten as PEP 621 metadata with uv_build (still shipping e2b and e2b_connect), poetry.lock is removed in favor of uv.lock, and dev deps move to [dependency-groups]. pydoc-markdown is dropped from dev deps; codegen tools live in a separate codegen group used by make init (uv sync --group codegen).

CI and local scripts swap setup-python + snok/install-poetry for astral-sh/setup-uv@v6 (pinned via .tool-versions: uv 0.10.0 replaces poetry). Workflows use uv sync --locked, uv build, uv version, and uv publish --token … --check-url … instead of Poetry equivalents. package.json and the Makefile route test/lint/publish through uv run; the standalone setup target is removed.

CLAUDE.md now tells contributors to use uv for Python dependencies.

Reviewed by Cursor Bugbot for commit 6bf4589. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Package Artifacts

Built from f521dfa. Download artifacts from this workflow run.

JS SDK (e2b@2.31.1-mishushakov-python-poetry-to-uv.0):

npm install ./e2b-2.31.1-mishushakov-python-poetry-to-uv.0.tgz

CLI (@e2b/cli@2.13.1-mishushakov-python-poetry-to-uv.0):

npm install ./e2b-cli-2.13.1-mishushakov-python-poetry-to-uv.0.tgz

Python SDK (e2b==2.30.0+mishushakov.python.poetry.to.uv):

pip install ./e2b-2.30.0+mishushakov.python.poetry.to.uv-py3-none-any.whl

Comment thread .github/workflows/publish_candidates.yml
The init target pip-installed codegen tools, but it was unreferenced,
inconsistent with codegen.Dockerfile (which uses the patched
e2b-openapi-python-client fork), and datamodel-code-generator is now a
dev dependency installed by `uv sync`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

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

Copy link
Copy Markdown

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: db7fecb3d5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/python-sdk/package.json Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f8f9ac1. Configure here.

Comment thread packages/python-sdk/Makefile
uv appends the package name to --check-url, so the project page
(.../simple/e2b/) gave the wrong prefix for duplicate-file detection.
Use the simple index root (.../simple/) so skip-existing works on
publish and RC workflows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread .github/workflows/publish_candidates.yml Outdated
Comment thread .github/workflows/lint.yml Outdated
mishushakov and others added 2 commits June 30, 2026 14:12
Bare `uv sync` silently re-resolves and rewrites uv.lock when
pyproject.toml drifts, unlike Poetry's non-mutating install. --locked
mirrors `pnpm install --frozen-lockfile` so CI fails with the real
cause instead of the misleading lint formatting error.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
uv provisions and pins the interpreter through setup-uv's python-version
input (fed from .tool-versions), so all uv commands use it. No workflow
invokes python directly, so the separate setup-python step is redundant.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mishushakov mishushakov enabled auto-merge (squash) June 30, 2026 13:13
mishushakov and others added 2 commits July 3, 2026 17:30
Local code generation needs pyyaml (for remove_extra_tags.py) and the
patched e2b-openapi-python-client, which were only ever available inside
the codegen Docker image. Add a pinned `codegen` dependency group
(mirroring codegen.Dockerfile) and restore `make init` as
`uv sync --group codegen` so `uv run make generate-api` works locally.
datamodel-code-generator moves from dev into codegen since it is only a
generation tool. generate-envd still needs Docker (Go/buf).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant