4fcf7cb150
The specs in `spec/` were copied from their source repos by hand and had
drifted ~2,400 lines behind infra, so they are now imported with
Copybara (`copy.bara.sky`, run in a pinned Docker image by
`scripts/fetch-spec.sh`): `make codegen` re-fetches them at the commits
pinned in `spec/infra-ref` and `spec/belt-ref` before generating, and
the generated-files CI check fails if the tracked copies don't match the
pins. Regenerating from the current pins picks up the accumulated spec
changes in the generated JS/Python clients (renamed request schemas,
`SandboxNetworkConfig`, `SandboxIam` workload identity,
`FILE_TYPE_SYMLINK`, access-token auth deprecation, volume path-metadata
tweaks). The one handwritten SDK change follows from that: the public
`FileType` enums gain a `SYMLINK` member (JS and both Python surfaces)
so entries envd reports as symlinks show up in `files.list()` and
`getInfo()`/`get_info()` instead of being silently skipped as unknown
types. The custom `spec/remove_extra_tags.py` tag-filtering script is
replaced by Redocly CLI's `filter-in` decorator (`redocly.yaml`), which
produces identical generated JS output; a `filter-out` decorator
additionally drops any operation or component schema the upstream specs
mark `x-not-implemented: true` (currently the SOCKS5
`SandboxEgressProxyConfig`/`egressProxy` surface, which infra flagged as
spec-only); each SDK's bundle now goes to its own gitignored
`spec/openapi_generated.<api>.yml` instead of both pipelines overwriting
one shared file; Python client models now list fields in spec order
instead of alphabetical (mechanical reordering only — construct models
with keyword args). Spec fetches try whatever GitHub token is available
and fall back to the tracked copies with a warning (the public infra
specs also fetch anonymously); in CI a short-lived belt-scoped token is
minted from the org-wide Autofixer GitHub App (no new secrets), so fork
PRs simply fall back for the belt spec; the CI workflows also cache the
Copybara image alongside the codegen image, and the previously ignored
`CODEGEN_IMAGE` env is honored by the Makefile.
## Usage
```sh
# update the specs: bump a pin, then regenerate
echo <infra-commit-sha> > spec/infra-ref
make codegen
# fetch a single spec without regenerating
pnpm fetch:api-spec # spec/openapi.yml from infra
pnpm fetch:envd-spec # spec/envd/ from infra
pnpm fetch:volume-spec # spec/openapi-volumecontent.yml from belt
# try the latest spec without touching the pin
E2B_INFRA_REF=main pnpm fetch:api-spec
# change which endpoint tags an SDK exposes
$EDITOR redocly.yaml && make codegen
```
```ts
// symlinks are now visible in the filesystem API (JS; same shape in Python)
const entries = await sandbox.files.list('/home/user')
const link = entries.find((e) => e.type === FileType.SYMLINK)
console.log(link?.symlinkTarget)
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
76 lines
1.9 KiB
TOML
76 lines
1.9 KiB
TOML
[project]
|
|
name = "e2b"
|
|
version = "2.34.0"
|
|
description = "E2B SDK that give agents cloud environments"
|
|
authors = [{ name = "e2b", email = "hello@e2b.dev" }]
|
|
license = "MIT"
|
|
readme = "README.md"
|
|
requires-python = ">=3.10"
|
|
dependencies = [
|
|
"python-dateutil>=2.8.2",
|
|
"wcmatch>=10.1,<11",
|
|
"protobuf-py>=0.1.1,<0.2",
|
|
"httpx>=0.27.0,<1.0.0",
|
|
"h2>=4,<5",
|
|
"attrs>=23.2.0",
|
|
"packaging>=24.1",
|
|
"typing-extensions>=4.1.0",
|
|
"dockerfile-parse>=2.0.1,<3",
|
|
"rich>=14.0.0",
|
|
"connectrpc>=0.11.1,<0.12",
|
|
"pyqwest>=0.7.0,<0.8",
|
|
]
|
|
|
|
[project.urls]
|
|
Homepage = "https://e2b.dev/"
|
|
Repository = "https://github.com/e2b-dev/e2b/tree/main/packages/python-sdk"
|
|
"Bug Tracker" = "https://github.com/e2b-dev/e2b/issues"
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"pytest>=9.0.3,<10",
|
|
"pytest-xdist>=3.3.1,<4",
|
|
"python-dotenv>=1.0.0,<2",
|
|
"pytest-dotenv>=0.5.2,<0.6",
|
|
"pytest-asyncio>=1.3.0,<2",
|
|
"ruff>=0.11.12,<0.12",
|
|
"pytest-timeout>=2.4.0,<3",
|
|
"ty>=0.0.15,<0.0.16",
|
|
]
|
|
|
|
# Tools for local code generation (`make init` && `uv run make generate-*`).
|
|
# Pins mirror codegen.Dockerfile so local output matches CI. `generate-api`
|
|
# additionally needs @redocly/cli on the PATH (pinned as a js-sdk
|
|
# devDependency and in codegen.Dockerfile — keep the versions in sync) and
|
|
# `generate-envd` needs `buf`.
|
|
codegen = [
|
|
"black==26.3.1",
|
|
"e2b-openapi-python-client==0.26.2",
|
|
"datamodel-code-generator==0.34.0",
|
|
"protoc-gen-connectrpc==0.11.1",
|
|
"protoc-gen-py==0.1.1",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["uv_build>=0.10.0,<0.11.0"]
|
|
build-backend = "uv_build"
|
|
|
|
[tool.uv.build-backend]
|
|
module-name = ["e2b"]
|
|
module-root = ""
|
|
|
|
[tool.basedpyright]
|
|
reportInconsistentOverload = false
|
|
|
|
[tool.ty.rules]
|
|
invalid-overload = "ignore"
|
|
no-matching-overload = "ignore"
|
|
|
|
[[tool.ty.overrides]]
|
|
include = ["e2b/api/client/models/**"]
|
|
rules = { invalid-argument-type = "ignore" }
|
|
|
|
[[tool.ty.overrides]]
|
|
include = ["e2b/volume/**"]
|
|
rules = { unresolved-attribute = "ignore" }
|