@e2b/python-sdk@2.52.0
Minor Changes
-
2de0cc3: Cap sandbox fork count at 20.
e2b sandbox fork --count, JavaScriptSandbox.fork({ count }), and PythonSandbox.fork(count=...)reject a count outside 1–20 before the API call. Counts from 21 through 100 used to reach the API. Omitting count still leaves the field off the request so the API default applies. -
03887ad: Apply
.dockerignoreandfileIgnorePatterns/file_ignore_patternsthe way Docker does when copying files into a template, so ignored files are no longer uploaded or included in the files hash:- A pattern that matches a directory (
node_modules,.git,dist/) now excludes everything under it, and a leading/is ignored. !patterns re-include paths; the last matching pattern wins.- In Python, patterns now also apply when the copied path contains
.or..segments (for examplecopy(".")). fileIgnorePatterns/file_ignore_patternsare applied after the.dockerignorelines, so they take precedence.- Absolute patterns pointing into the context directory are treated as relative to it.
- Brace expansion (
{a,b}) is not supported, as in Docker. In JS,fileIgnorePatternssuch as**/*.{env,pem}previously expanded and now match{env,pem}literally; list each pattern separately instead (**/*.env,**/*.pem). - In Python, copying a symlink to a directory copies the link itself instead of the directory's contents, as in JS.
- Copying a path inside an ignored directory now fails with "No files found", as in Docker. An invalid pattern (such as an unterminated
[) now raises an error.
Directory sizes are no longer part of the files hash, since they depend on the filesystem rather than on the copied files. The files hash of
copy()steps that copy directories or are affected by ignore patterns changes once, so those steps are rebuilt on the next build. - A pattern that matches a directory (
-
2f92cc3: Add an
http_version(Python) /httpVersion(JS) connection option,"1.1"or"2"(default), also settable with theE2B_HTTP_VERSIONenvironment variable, to pin requests to the E2B API, to sandboxes (commands, filesystem, PTY) and to volume content to HTTP/1.1. It can also be bound once on a client:E2B(http_version="1.1")/new E2B({ httpVersion: '1.1' }).
Patch Changes
- 97522f8: Retry control-plane HTTP requests after
502and503responses, in addition to429, and after a network error once the request was written (dropped connection) — except forPOSToperations not known to be safe to replay (sandbox creation, fork, snapshot, volume/secret/API-key/webhook creation), which the server may already have processed. Failures to establish the connection keep being retried for every operation (E2B_CONNECTION_RETRIES).Retry-Afteris honored when the server sends one; otherwise retries back off exponentially with jitter, starting at 0.1 seconds and capped at 10 seconds. The existingretriesoption (default 3,0to disable) and request-timeout budget apply to all of them. - f713914: Sandbox
commands/filestraffic is now balanced across HTTP/2 connections the way the JS SDK's undici agent does it, instead of being sharded into a fixed number of pools by sandbox ID. Every request goes to the connection with the fewest streams in flight to its host; a new connection is dialed only when all existing ones already carryE2B_STREAMS_PER_CONNECTIONstreams to that host (default100), up toE2B_MAX_CONNECTIONS(default200). Envd RPC and HTTP calls share the same connections.E2B_ENVD_POOL_SHARDSand thepool_shardargument of the internal transport factories (get_transport,get_httpx_transport,get_pyqwest_transport,get_envd_transport) are removed. - 4975149: Remove unused internal constants and attributes, and share the command handle setup between
Commands.runandCommands.connect