Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/code_interpreter_python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ jobs:
enable-cache: true

- name: Install dependencies
run: uv sync --locked --package e2b-code-interpreter
run: uv sync --locked --all-packages

- name: Test build
run: uv build
run: uv build --out-dir dist

- name: Run tests
run: |
if [[ "${{ inputs.run_recovery_tests }}" == "true" ]]; then
uv run pytest --verbose --numprocesses=4
uv run --all-packages pytest --verbose --numprocesses=4
else
uv run pytest --verbose --numprocesses=4 \
uv run --all-packages pytest --verbose --numprocesses=4 \
--ignore=tests/async/test_async_interrupt.py \
--ignore=tests/async/test_async_systemd.py \
--ignore=tests/sync/test_interrupt.py \
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/desktop_python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ jobs:
enable-cache: true

- name: Install dependencies
run: uv sync --locked --package e2b-desktop
run: uv sync --locked --all-packages

- name: Test build
run: uv build
run: uv build --out-dir dist

- name: Run tests
if: inputs.run_tests
run: uv run pytest --verbose --numprocesses=4
run: uv run --all-packages pytest --verbose --numprocesses=4
env:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}
5 changes: 3 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
- '.prettierignore'
- '.editorconfig'
- 'pnpm-lock.yaml'
- 'uv.lock'
- 'pyproject.toml'
- 'pnpm-workspace.yaml'
- 'package.json'
- '.tool-versions'
Expand Down Expand Up @@ -77,9 +79,8 @@ jobs:
enable-cache: true

- name: Install Python dependencies
working-directory: packages/python-sdk
run: |
uv sync --locked
uv sync --locked --all-packages

- name: Run linting
run: |
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/pkg_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,16 @@ jobs:
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
enable-cache: true

# `--out-dir dist` on every Python build below: inside a uv workspace
# `uv build` defaults to the workspace root's `dist/`, which would collect
# all three SDKs in one directory and leave the per-package paths these
# uploads (and `uv publish`) expect empty.
- name: Build Python SDK
working-directory: packages/python-sdk
run: |
BASE_VERSION=$(uv version --short)
uv version "${BASE_VERSION}+${BRANCH_ID}"
uv build
uv build --out-dir dist

- name: Upload Python SDK artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
Expand All @@ -144,7 +148,7 @@ jobs:
run: |
BASE_VERSION=$(uv version --short)
uv version "${BASE_VERSION}+${BRANCH_ID}"
uv build
uv build --out-dir dist

- name: Upload Code Interpreter Python SDK artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
Expand All @@ -157,7 +161,7 @@ jobs:
run: |
BASE_VERSION=$(uv version --short)
uv version "${BASE_VERSION}+${BRANCH_ID}"
uv build
uv build --out-dir dist

- name: Upload Desktop Python SDK artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_candidates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
run: |
BASE_VERSION=$(uv version --short)
uv version "${BASE_VERSION}rc${{ github.run_id }}"
uv build
uv build --out-dir dist
uv publish --token ${PYPI_TOKEN} --check-url https://pypi.org/simple/
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python_sdk_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ jobs:
enable-cache: true

- name: Install dependencies
run: uv sync --locked
run: uv sync --locked --all-packages

- name: Test build
run: uv build
run: uv build --out-dir dist

- name: Run tests
run: uv run pytest --verbose --numprocesses=4
run: uv run --all-packages pytest --verbose --numprocesses=4
env:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}
6 changes: 6 additions & 0 deletions .github/workflows/sdk_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ jobs:
- 'tsconfig.sdk.json'
- 'tsdown.sdk.config.mts'
- 'packages/js-sdk/**/!(*.md)'
python-shared: &python-shared
- 'pyproject.toml'
- 'uv.lock'
python:
- *shared
- *python-shared
- '.github/workflows/python_sdk_tests.yml'
- 'packages/python-sdk/**/!(*.md)'
cli:
Expand All @@ -67,6 +71,7 @@ jobs:
- 'packages/js-sdk/**/!(*.md)'
code_interpreter_python:
- *shared
- *python-shared
- '.github/workflows/code_interpreter_python_tests.yml'
- 'packages/code-interpreter-python/**/!(*.md)'
- 'packages/python-sdk/**/!(*.md)'
Expand All @@ -80,6 +85,7 @@ jobs:
- 'packages/js-sdk/**/!(*.md)'
desktop_python:
- *shared
- *python-shared
- '.github/workflows/desktop_python_tests.yml'
- 'packages/desktop-python/**/!(*.md)'
- 'packages/python-sdk/**/!(*.md)'
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
- 'packages/**/!(*.md)'
- 'spec/**/!(*.md)'
- 'pnpm-lock.yaml'
- 'uv.lock'
- 'pyproject.toml'
- 'pnpm-workspace.yaml'
- 'package.json'
- '.tool-versions'
Expand Down Expand Up @@ -73,9 +75,8 @@ jobs:
enable-cache: true

- name: Install Python dependencies
working-directory: packages/python-sdk
run: |
uv sync --locked
uv sync --locked --all-packages

- name: Run typecheck
run: |
Expand Down
8 changes: 4 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,21 @@
"python.autoComplete.extraPaths": [
"./**",
"./packages/python-sdk/**",
"./packages/python-sdk/.venv/bin/python",
"./.venv/bin/python",
],
"python.defaultInterpreterPath": "./packages/python-sdk/.venv/bin/python",
"python.defaultInterpreterPath": "./.venv/bin/python",
"python.analysis.extraPaths": [
"./**",
"./packages/python-sdk/**",
"./packages/python-sdk/.venv/bin/python"
"./.venv/bin/python"
],
// Disable Pylint and use just Pylance
"python.linting.enabled": false,
"python.analysis.typeCheckingMode": "basic",
"cursorpyright.analysis.extraPaths": [
"./**",
"./packages/python-sdk/**",
"./packages/python-sdk/.venv/bin/python"
"./.venv/bin/python"
],
"cursorpyright.analysis.typeCheckingMode": "basic",
// "python.analysis.pylanceLspClientEnabled": true,
Expand Down
17 changes: 17 additions & 0 deletions DEV.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Releasing e2b cli

to create a changeset run `pnpm run changeset`

# Python packages

`packages/python-sdk`, `packages/code-interpreter-python` and `packages/desktop-python` form a
[uv workspace](https://docs.astral.sh/uv/concepts/projects/workspaces/) rooted at the repository
root, sharing a single `uv.lock` and `.venv`:

```sh
uv sync --all-packages
uv run --all-packages pytest # from a package directory
```

Build artifacts go to the workspace root's `dist/` unless a package-local one is requested, so the
release and artifact tooling builds with `uv build --out-dir dist` from the package directory.

Their `package.json`s are pnpm-workspace stubs that exist only so changesets versions and releases
them alongside the JavaScript packages; the scripts they expose delegate to uv.
2 changes: 1 addition & 1 deletion packages/code-interpreter-python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ format:

.PHONY: test
test:
uv run pytest --verbose --numprocesses=4
uv run --all-packages pytest --verbose --numprocesses=4
10 changes: 5 additions & 5 deletions packages/code-interpreter-python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"private": true,
"version": "2.9.1",
"scripts": {
"test": "uv run pytest -n 4 --verbose -x",
"test": "uv run --all-packages pytest -n 4 --verbose -x",
"postVersion": "uv version $(pnpm pkg get version --workspaces=false | tr -d \\\")",
"postPublish": "uv build && uv publish --token ${PYPI_TOKEN} --check-url https://pypi.org/simple/",
"typecheck": "uv run make typecheck",
"lint": "uv run make lint",
"format": "uv run make format"
"postPublish": "uv build --out-dir dist && uv publish --token ${PYPI_TOKEN} --check-url https://pypi.org/simple/",
"typecheck": "uv run --all-packages make typecheck",
"lint": "uv run --all-packages make lint",
"format": "uv run --all-packages make format"
}
}
6 changes: 0 additions & 6 deletions packages/code-interpreter-python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,5 @@ build-backend = "uv_build"
module-name = ["e2b_code_interpreter"]
module-root = ""

[tool.uv.sources]
e2b = { workspace = true }

[tool.uv.workspace]
members = ["../python-sdk"]

[tool.ruff.lint]
ignore = ["F401", "F403"]
2 changes: 1 addition & 1 deletion packages/desktop-python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ format:

.PHONY: test
test:
uv run pytest --verbose --numprocesses=4
uv run --all-packages pytest --verbose --numprocesses=4
10 changes: 5 additions & 5 deletions packages/desktop-python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"private": true,
"version": "2.4.3",
"scripts": {
"test": "uv run pytest -n 4 --verbose -x",
"test": "uv run --all-packages pytest -n 4 --verbose -x",
"postVersion": "uv version $(pnpm pkg get version --workspaces=false | tr -d \\\")",
"postPublish": "uv build && uv publish --token ${PYPI_TOKEN} --check-url https://pypi.org/simple/",
"typecheck": "uv run make typecheck",
"lint": "uv run make lint",
"format": "uv run make format"
"postPublish": "uv build --out-dir dist && uv publish --token ${PYPI_TOKEN} --check-url https://pypi.org/simple/",
"typecheck": "uv run --all-packages make typecheck",
"lint": "uv run --all-packages make lint",
"format": "uv run --all-packages make format"
}
}
6 changes: 0 additions & 6 deletions packages/desktop-python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ build-backend = "uv_build"
module-name = ["e2b_desktop"]
module-root = ""

[tool.uv.sources]
e2b = { workspace = true }

[tool.uv.workspace]
members = ["../python-sdk"]

[tool.ruff.lint]
ignore = ["F401", "F403"]

Expand Down
Loading
Loading