Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Make codegen robust and deterministic for js and python SDKs (#664)

0dive0c1bc752dfa
diff --git a/Makefile b/Makefile
index af4b39302..7829df7cc 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,10 @@ update-api-spec:
@./scripts/update-api-spec.sh
@echo "Done"
+.PHONY: codegen
+codegen:
+ @echo "Generating SDK code from openapi and envd spec"
+ @./scripts/codegen.sh
generate: generate-js generate-python
@@ -12,7 +16,9 @@ generate-js:
cd spec/envd && buf generate --template buf-js.gen.yaml
generate-python:
- $(MAKE) -C packages/connect-python build
+ if [ ! -f "/go/bin/protoc-gen-connect-python" ]; then \
+ $(MAKE) -C packages/connect-python build; \
+ fi
cd packages/python-sdk && make generate-api
cd spec/envd && buf generate --template buf-python.gen.yaml
cd packages/python-sdk && ./scripts/fix-python-pb.sh && black .
diff --git a/codegen.Dockerfile b/codegen.Dockerfile
new file mode 100644
index 000000000..4f0d3e497
--- /dev/null
+++ b/codegen.Dockerfile
@@ -0,0 +1,44 @@
+FROM golang:1.23
+
+# Install Golang deps
+RUN go install github.com/bufbuild/buf/cmd/[email protected] && \
+ go install google.golang.org/protobuf/cmd/[email protected] && \
+ go install connectrpc.com/connect/cmd/[email protected]
+
+# Install our custom protoc plugin, connect-python
+COPY ./packages/connect-python /packages/connect-python
+RUN cd /packages/connect-python && make bin/protoc-gen-connect-python
+
+
+FROM python:3.9
+
+# Set working directory
+WORKDIR /workspace
+
+ENV PROTOC_ZIP=protoc-29.3-linux-aarch_64.zip
+
+RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v29.3/$PROTOC_ZIP
+RUN unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
+
+# Copy installed Go deps from previous build step
+COPY --from=0 /go /go
+
+# Add Go binary to PATH
+ENV PATH="/go/bin:${PATH}"
+
+# Install Python deps
+RUN pip install black==23.7.0 pyyaml==6.0.2 openapi-python-client==0.24.3
+
+# Install Node.js and npm
+RUN apt-get update && \
+ apt-get install -y curl && \
+ curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
+ apt-get install -y nodejs && \
+ apt-get clean && \
+ rm -rf /var/lib/apt/lists/*
+
+# Install Node.js deps
+RUN npm install -g pnpm @connectrpc/[email protected] @bufbuild/[email protected]
+
+# Generate when container starts
+CMD ["make", "generate"]
diff --git a/packages/connect-python/Makefile b/packages/connect-python/Makefile
index 016c2f5c5..678288629 100644
--- a/packages/connect-python/Makefile
+++ b/packages/connect-python/Makefile
@@ -21,9 +21,7 @@ upload: clean
bin/$(plugin): $(wildcard cmd/$(plugin)/*.go) pyproject.toml Makefile
- go build -o $@ \
- -ldflags "-w -s" \
- ./cmd/$(plugin)
+ go install -ldflags "-w -s" ./cmd/$(plugin)
.PHONY: dev fmt lint upload clean build
diff --git a/packages/js-sdk/src/envd/schema.gen.ts b/packages/js-sdk/src/envd/schema.gen.ts
index d415c0789..8a256f5a6 100644
--- a/packages/js-sdk/src/envd/schema.gen.ts
+++ b/packages/js-sdk/src/envd/schema.gen.ts
@@ -3,166 +3,248 @@
* Do not make direct changes to the file.
*/
-
export interface paths {
- "/files": {
- /** Download a file */
- get: {
- parameters: {
- query: {
- path?: components["parameters"]["FilePath"];
- username: components["parameters"]["User"];
- };
- };
- responses: {
- 200: components["responses"]["DownloadSuccess"];
- 400: components["responses"]["InvalidPath"];
- 401: components["responses"]["InvalidUser"];
- 404: components["responses"]["FileNotFound"];
- 500: components["responses"]["InternalServerError"];
- };
- };
- /** Upload a file and ensure the parent directories exist. If the file exists, it will be overwritten. */
- post: {
- parameters: {
- query: {
- path?: components["parameters"]["FilePath"];
- username: components["parameters"]["User"];
- };
- };
- requestBody: components["requestBodies"]["File"];
- responses: {
- 200: components["responses"]["UploadSuccess"];
- 400: components["responses"]["InvalidPath"];
- 401: components["responses"]["InvalidUser"];
- 500: components["responses"]["InternalServerError"];
- 507: components["responses"]["NotEnoughDiskSpace"];
- };
+ "/files": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /** Download a file */
+ get: {
+ parameters: {
+ query: {
+ /** @description Path to the file, URL encoded. Can be relative to user's home directory. */
+ path?: components["parameters"]["FilePath"];
+ /** @description User used for setting the owner, or resolving relative paths. */
+ username: components["parameters"]["User"];
+ };
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ 200: components["responses"]["DownloadSuccess"];
+ 400: components["responses"]["InvalidPath"];
+ 401: components["responses"]["InvalidUser"];
+ 404: components["responses"]["FileNotFound"];
+ 500: components["responses"]["InternalServerError"];
+ };
+ };
+ put?: never;
+ /** Upload a file and ensure the parent directories exist. If the file exists, it will be overwritten. */
+ post: {
+ parameters: {
+ query: {
+ /** @description Path to the file, URL encoded. Can be relative to user's home directory. */
+ path?: components["parameters"]["FilePath"];
+ /** @description User used for setting the owner, or resolving relative paths. */
+ username: components["parameters"]["User"];
+ };
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody: components["requestBodies"]["File"];
+ responses: {
+ 200: components["responses"]["UploadSuccess"];
+ 400: components["responses"]["InvalidPath"];
+ 401: components["responses"]["InvalidUser"];
+ 500: components["responses"]["InternalServerError"];
+ 507: components["responses"]["NotEnoughDiskSpace"];
+ };
+ };
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
};
- };
- "/health": {
- /** Check the health of the service */
- get: {
- responses: {
- /** @description The service is healthy */
- 204: {
- content: never;
- };
- };
+ "/health": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /** Check the health of the service */
+ get: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The service is healthy */
+ 204: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ };
+ };
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
};
- };
- "/init": {
- /** Set env vars, ensure the time and metadata is synced with the host */
- post: {
- requestBody?: {
- content: {
- "application/json": {
- envVars?: components["schemas"]["EnvVars"];
- };
- };
- };
- responses: {
- /** @description Env vars set, the time and metadata is synced with the host */
- 204: {
- content: never;
- };
- };
+ "/init": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ get?: never;
+ put?: never;
+ /** Set env vars, ensure the time and metadata is synced with the host */
+ post: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: {
+ content: {
+ "application/json": {
+ envVars?: components["schemas"]["EnvVars"];
+ };
+ };
+ };
+ responses: {
+ /** @description Env vars set, the time and metadata is synced with the host */
+ 204: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ };
+ };
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
};
- };
}
-
export type webhooks = Record<string, never>;
-
export interface components {
- schemas: {
- EntryInfo: {
- /** @description Name of the file */
- name: string;
- /** @description Path to the file */
- path: string;
- /**
- * @description Type of the file
- * @enum {string}
- */
- type: "file";
- };
- /** @description Environment variables to set */
- EnvVars: {
- [key: string]: string;
- };
- Error: {
- /** @description Error code */
- code: number;
- /** @description Error message */
- message: string;
- };
- };
- responses: {
- /** @description Entire file downloaded successfully. */
- DownloadSuccess: {
- content: {
- "application/octet-stream": string;
- };
- };
- /** @description File not found */
- FileNotFound: {
- content: {
- "application/json": components["schemas"]["Error"];
- };
- };
- /** @description Internal server error */
- InternalServerError: {
- content: {
- "application/json": components["schemas"]["Error"];
- };
- };
- /** @description Invalid path */
- InvalidPath: {
- content: {
- "application/json": components["schemas"]["Error"];
- };
- };
- /** @description Invalid user */
- InvalidUser: {
- content: {
- "application/json": components["schemas"]["Error"];
- };
+ schemas: {
+ EntryInfo: {
+ /** @description Name of the file */
+ name: string;
+ /** @description Path to the file */
+ path: string;
+ /**
+ * @description Type of the file
+ * @enum {string}
+ */
+ type: "file";
+ };
+ /** @description Environment variables to set */
+ EnvVars: {
+ [key: string]: string;
+ };
+ Error: {
+ /** @description Error code */
+ code: number;
+ /** @description Error message */
+ message: string;
+ };
};
- /** @description Not enough disk space */
- NotEnoughDiskSpace: {
- content: {
- "application/json": components["schemas"]["Error"];
- };
+ responses: {
+ /** @description Entire file downloaded successfully. */
+ DownloadSuccess: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/octet-stream": string;
+ };
+ };
+ /** @description File not found */
+ FileNotFound: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description Internal server error */
+ InternalServerError: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description Invalid path */
+ InvalidPath: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description Invalid user */
+ InvalidUser: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description Not enough disk space */
+ NotEnoughDiskSpace: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description The file was uploaded successfully. */
+ UploadSuccess: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["EntryInfo"][];
+ };
+ };
};
- /** @description The file was uploaded successfully. */
- UploadSuccess: {
- content: {
- "application/json": components["schemas"]["EntryInfo"][];
- };
+ parameters: {
+ /** @description Path to the file, URL encoded. Can be relative to user's home directory. */
+ FilePath: string;
+ /** @description User used for setting the owner, or resolving relative paths. */
+ User: string;
};
- };
- parameters: {
- /** @description Path to the file, URL encoded. Can be relative to user's home directory. */
- FilePath?: string;
- /** @description User used for setting the owner, or resolving relative paths. */
- User: string;
- };
- requestBodies: {
- File: {
- content: {
- "multipart/form-data": {
- /** Format: binary */
- file?: string;
- };
- };
+ requestBodies: {
+ File: {
+ content: {
+ "multipart/form-data": {
+ /** Format: binary */
+ file?: string;
+ };
+ };
+ };
};
- };
- headers: never;
- pathItems: never;
+ headers: never;
+ pathItems: never;
}
-
export type $defs = Record<string, never>;
-
-export type external = Record<string, never>;
-
export type operations = Record<string, never>;
diff --git a/packages/python-sdk/e2b/api/client/api/sandboxes/__init__.py b/packages/python-sdk/e2b/api/client/api/sandboxes/__init__.py
index e69de29bb..2d7c0b23d 100644
--- a/packages/python-sdk/e2b/api/client/api/sandboxes/__init__.py
+++ b/packages/python-sdk/e2b/api/client/api/sandboxes/__init__.py
@@ -0,0 +1 @@
+"""Contains endpoint functions for accessing the API"""
diff --git a/packages/python-sdk/e2b/api/client/api/sandboxes/delete_sandboxes_sandbox_id.py b/packages/python-sdk/e2b/api/client/api/sandboxes/delete_sandboxes_sandbox_id.py
index b5deb5cff..77288c4ca 100644
--- a/packages/python-sdk/e2b/api/client/api/sandboxes/delete_sandboxes_sandbox_id.py
+++ b/packages/python-sdk/e2b/api/client/api/sandboxes/delete_sandboxes_sandbox_id.py
@@ -1,10 +1,11 @@
from http import HTTPStatus
-from typing import Any, Optional, Union
+from typing import Any, Optional, Union, cast
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
+from ...models.error import Error
from ...types import Response
@@ -19,22 +20,33 @@ def _get_kwargs(
return _kwargs
-def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
+def _parse_response(
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
+) -> Optional[Union[Any, Error]]:
if response.status_code == 204:
- return None
+ response_204 = cast(Any, None)
+ return response_204
if response.status_code == 401:
- return None
+ response_401 = Error.from_dict(response.json())
+
+ return response_401
if response.status_code == 404:
- return None
+ response_404 = Error.from_dict(response.json())
+
+ return response_404
if response.status_code == 500:
- return None
+ response_500 = Error.from_dict(response.json())
+
+ return response_500
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
-def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
+def _build_response(
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
+) -> Response[Union[Any, Error]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
@@ -47,7 +59,7 @@ def sync_detailed(
sandbox_id: str,
*,
client: AuthenticatedClient,
-) -> Response[Any]:
+) -> Response[Union[Any, Error]]:
"""Kill a sandbox
Args:
@@ -58,7 +70,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Any]
+ Response[Union[Any, Error]]
"""
kwargs = _get_kwargs(
@@ -72,11 +84,35 @@ def sync_detailed(
return _build_response(client=client, response=response)
+def sync(
+ sandbox_id: str,
+ *,
+ client: AuthenticatedClient,
+) -> Optional[Union[Any, Error]]:
+ """Kill a sandbox
+
+ Args:
+ sandbox_id (str):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Union[Any, Error]
+ """
+
+ return sync_detailed(
+ sandbox_id=sandbox_id,
+ client=client,
+ ).parsed
+
+
async def asyncio_detailed(
sandbox_id: str,
*,
client: AuthenticatedClient,
-) -> Response[Any]:
+) -> Response[Union[Any, Error]]:
"""Kill a sandbox
Args:
@@ -87,7 +123,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Any]
+ Response[Union[Any, Error]]
"""
kwargs = _get_kwargs(
@@ -97,3 +133,29 @@ async def asyncio_detailed(
response = await client.get_async_httpx_client().request(**kwargs)
return _build_response(client=client, response=response)
+
+
+async def asyncio(
+ sandbox_id: str,
+ *,
+ client: AuthenticatedClient,
+) -> Optional[Union[Any, Error]]:
+ """Kill a sandbox
+
+ Args:
+ sandbox_id (str):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Union[Any, Error]
+ """
+
+ return (
+ await asyncio_detailed(
+ sandbox_id=sandbox_id,
+ client=client,
+ )
+ ).parsed
diff --git a/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes.py b/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes.py
index ede683744..ecc6c2814 100644
--- a/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes.py
+++ b/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes.py
@@ -1,10 +1,11 @@
from http import HTTPStatus
-from typing import Any, Optional, Union, cast
+from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
+from ...models.error import Error
from ...models.running_sandbox import RunningSandbox
from ...types import UNSET, Response, Unset
@@ -30,7 +31,7 @@ def _get_kwargs(
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
-) -> Optional[Union[Any, list["RunningSandbox"]]]:
+) -> Optional[Union[Error, list["RunningSandbox"]]]:
if response.status_code == 200:
response_200 = []
_response_200 = response.json()
@@ -41,13 +42,16 @@ def _parse_response(
return response_200
if response.status_code == 400:
- response_400 = cast(Any, None)
+ response_400 = Error.from_dict(response.json())
+
return response_400
if response.status_code == 401:
- response_401 = cast(Any, None)
+ response_401 = Error.from_dict(response.json())
+
return response_401
if response.status_code == 500:
- response_500 = cast(Any, None)
+ response_500 = Error.from_dict(response.json())
+
return response_500
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
@@ -57,7 +61,7 @@ def _parse_response(
def _build_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
-) -> Response[Union[Any, list["RunningSandbox"]]]:
+) -> Response[Union[Error, list["RunningSandbox"]]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
@@ -70,7 +74,7 @@ def sync_detailed(
*,
client: AuthenticatedClient,
metadata: Union[Unset, str] = UNSET,
-) -> Response[Union[Any, list["RunningSandbox"]]]:
+) -> Response[Union[Error, list["RunningSandbox"]]]:
"""List all running sandboxes
Args:
@@ -81,7 +85,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Union[Any, list['RunningSandbox']]]
+ Response[Union[Error, list['RunningSandbox']]]
"""
kwargs = _get_kwargs(
@@ -99,7 +103,7 @@ def sync(
*,
client: AuthenticatedClient,
metadata: Union[Unset, str] = UNSET,
-) -> Optional[Union[Any, list["RunningSandbox"]]]:
+) -> Optional[Union[Error, list["RunningSandbox"]]]:
"""List all running sandboxes
Args:
@@ -110,7 +114,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Union[Any, list['RunningSandbox']]
+ Union[Error, list['RunningSandbox']]
"""
return sync_detailed(
@@ -123,7 +127,7 @@ async def asyncio_detailed(
*,
client: AuthenticatedClient,
metadata: Union[Unset, str] = UNSET,
-) -> Response[Union[Any, list["RunningSandbox"]]]:
+) -> Response[Union[Error, list["RunningSandbox"]]]:
"""List all running sandboxes
Args:
@@ -134,7 +138,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Union[Any, list['RunningSandbox']]]
+ Response[Union[Error, list['RunningSandbox']]]
"""
kwargs = _get_kwargs(
@@ -150,7 +154,7 @@ async def asyncio(
*,
client: AuthenticatedClient,
metadata: Union[Unset, str] = UNSET,
-) -> Optional[Union[Any, list["RunningSandbox"]]]:
+) -> Optional[Union[Error, list["RunningSandbox"]]]:
"""List all running sandboxes
Args:
@@ -161,7 +165,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Union[Any, list['RunningSandbox']]
+ Union[Error, list['RunningSandbox']]
"""
return (
diff --git a/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes_metrics.py b/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes_metrics.py
index 689551f26..b26bbcfb3 100644
--- a/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes_metrics.py
+++ b/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes_metrics.py
@@ -1,10 +1,11 @@
from http import HTTPStatus
-from typing import Any, Optional, Union, cast
+from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
+from ...models.error import Error
from ...models.running_sandbox_with_metrics import RunningSandboxWithMetrics
from ...types import UNSET, Response, Unset
@@ -30,24 +31,29 @@ def _get_kwargs(
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
-) -> Optional[Union[Any, list["RunningSandboxWithMetrics"]]]:
+) -> Optional[Union[Error, list["RunningSandboxWithMetrics"]]]:
if response.status_code == 200:
response_200 = []
_response_200 = response.json()
for response_200_item_data in _response_200:
- response_200_item = RunningSandboxWithMetrics.from_dict(response_200_item_data)
+ response_200_item = RunningSandboxWithMetrics.from_dict(
+ response_200_item_data
+ )
response_200.append(response_200_item)
return response_200
if response.status_code == 400:
- response_400 = cast(Any, None)
+ response_400 = Error.from_dict(response.json())
+
return response_400
if response.status_code == 401:
- response_401 = cast(Any, None)
+ response_401 = Error.from_dict(response.json())
+
return response_401
if response.status_code == 500:
- response_500 = cast(Any, None)
+ response_500 = Error.from_dict(response.json())
+
return response_500
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
@@ -57,7 +63,7 @@ def _parse_response(
def _build_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
-) -> Response[Union[Any, list["RunningSandboxWithMetrics"]]]:
+) -> Response[Union[Error, list["RunningSandboxWithMetrics"]]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
@@ -70,7 +76,7 @@ def sync_detailed(
*,
client: AuthenticatedClient,
metadata: Union[Unset, str] = UNSET,
-) -> Response[Union[Any, list["RunningSandboxWithMetrics"]]]:
+) -> Response[Union[Error, list["RunningSandboxWithMetrics"]]]:
"""List all running sandboxes with metrics
Args:
@@ -81,7 +87,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Union[Any, list['RunningSandboxWithMetrics']]]
+ Response[Union[Error, list['RunningSandboxWithMetrics']]]
"""
kwargs = _get_kwargs(
@@ -99,7 +105,7 @@ def sync(
*,
client: AuthenticatedClient,
metadata: Union[Unset, str] = UNSET,
-) -> Optional[Union[Any, list["RunningSandboxWithMetrics"]]]:
+) -> Optional[Union[Error, list["RunningSandboxWithMetrics"]]]:
"""List all running sandboxes with metrics
Args:
@@ -110,7 +116,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Union[Any, list['RunningSandboxWithMetrics']]
+ Union[Error, list['RunningSandboxWithMetrics']]
"""
return sync_detailed(
@@ -123,7 +129,7 @@ async def asyncio_detailed(
*,
client: AuthenticatedClient,
metadata: Union[Unset, str] = UNSET,
-) -> Response[Union[Any, list["RunningSandboxWithMetrics"]]]:
+) -> Response[Union[Error, list["RunningSandboxWithMetrics"]]]:
"""List all running sandboxes with metrics
Args:
@@ -134,7 +140,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Union[Any, list['RunningSandboxWithMetrics']]]
+ Response[Union[Error, list['RunningSandboxWithMetrics']]]
"""
kwargs = _get_kwargs(
@@ -150,7 +156,7 @@ async def asyncio(
*,
client: AuthenticatedClient,
metadata: Union[Unset, str] = UNSET,
-) -> Optional[Union[Any, list["RunningSandboxWithMetrics"]]]:
+) -> Optional[Union[Error, list["RunningSandboxWithMetrics"]]]:
"""List all running sandboxes with metrics
Args:
@@ -161,7 +167,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Union[Any, list['RunningSandboxWithMetrics']]
+ Union[Error, list['RunningSandboxWithMetrics']]
"""
return (
diff --git a/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes_sandbox_id.py b/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes_sandbox_id.py
index a03cae73e..c824db698 100644
--- a/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes_sandbox_id.py
+++ b/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes_sandbox_id.py
@@ -1,10 +1,11 @@
from http import HTTPStatus
-from typing import Any, Optional, Union, cast
+from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
+from ...models.error import Error
from ...models.running_sandbox import RunningSandbox
from ...types import Response
@@ -22,19 +23,22 @@ def _get_kwargs(
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
-) -> Optional[Union[Any, RunningSandbox]]:
+) -> Optional[Union[Error, RunningSandbox]]:
if response.status_code == 200:
response_200 = RunningSandbox.from_dict(response.json())
return response_200
if response.status_code == 401:
- response_401 = cast(Any, None)
+ response_401 = Error.from_dict(response.json())
+
return response_401
if response.status_code == 404:
- response_404 = cast(Any, None)
+ response_404 = Error.from_dict(response.json())
+
return response_404
if response.status_code == 500:
- response_500 = cast(Any, None)
+ response_500 = Error.from_dict(response.json())
+
return response_500
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
@@ -44,7 +48,7 @@ def _parse_response(
def _build_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
-) -> Response[Union[Any, RunningSandbox]]:
+) -> Response[Union[Error, RunningSandbox]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
@@ -57,7 +61,7 @@ def sync_detailed(
sandbox_id: str,
*,
client: AuthenticatedClient,
-) -> Response[Union[Any, RunningSandbox]]:
+) -> Response[Union[Error, RunningSandbox]]:
"""Get a sandbox by id
Args:
@@ -68,7 +72,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Union[Any, RunningSandbox]]
+ Response[Union[Error, RunningSandbox]]
"""
kwargs = _get_kwargs(
@@ -86,7 +90,7 @@ def sync(
sandbox_id: str,
*,
client: AuthenticatedClient,
-) -> Optional[Union[Any, RunningSandbox]]:
+) -> Optional[Union[Error, RunningSandbox]]:
"""Get a sandbox by id
Args:
@@ -97,7 +101,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Union[Any, RunningSandbox]
+ Union[Error, RunningSandbox]
"""
return sync_detailed(
@@ -110,7 +114,7 @@ async def asyncio_detailed(
sandbox_id: str,
*,
client: AuthenticatedClient,
-) -> Response[Union[Any, RunningSandbox]]:
+) -> Response[Union[Error, RunningSandbox]]:
"""Get a sandbox by id
Args:
@@ -121,7 +125,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Union[Any, RunningSandbox]]
+ Response[Union[Error, RunningSandbox]]
"""
kwargs = _get_kwargs(
@@ -137,7 +141,7 @@ async def asyncio(
sandbox_id: str,
*,
client: AuthenticatedClient,
-) -> Optional[Union[Any, RunningSandbox]]:
+) -> Optional[Union[Error, RunningSandbox]]:
"""Get a sandbox by id
Args:
@@ -148,7 +152,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Union[Any, RunningSandbox]
+ Union[Error, RunningSandbox]
"""
return (
diff --git a/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes_sandbox_id_logs.py b/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes_sandbox_id_logs.py
index 11d665612..a72765c53 100644
--- a/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes_sandbox_id_logs.py
+++ b/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes_sandbox_id_logs.py
@@ -1,10 +1,11 @@
from http import HTTPStatus
-from typing import Any, Optional, Union, cast
+from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
+from ...models.error import Error
from ...models.sandbox_logs import SandboxLogs
from ...types import UNSET, Response, Unset
@@ -34,19 +35,22 @@ def _get_kwargs(
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
-) -> Optional[Union[Any, SandboxLogs]]:
+) -> Optional[Union[Error, SandboxLogs]]:
if response.status_code == 200:
response_200 = SandboxLogs.from_dict(response.json())
return response_200
if response.status_code == 401:
- response_401 = cast(Any, None)
+ response_401 = Error.from_dict(response.json())
+
return response_401
if response.status_code == 404:
- response_404 = cast(Any, None)
+ response_404 = Error.from_dict(response.json())
+
return response_404
if response.status_code == 500:
- response_500 = cast(Any, None)
+ response_500 = Error.from_dict(response.json())
+
return response_500
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
@@ -56,7 +60,7 @@ def _parse_response(
def _build_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
-) -> Response[Union[Any, SandboxLogs]]:
+) -> Response[Union[Error, SandboxLogs]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
@@ -71,7 +75,7 @@ def sync_detailed(
client: AuthenticatedClient,
start: Union[Unset, int] = UNSET,
limit: Union[Unset, int] = 1000,
-) -> Response[Union[Any, SandboxLogs]]:
+) -> Response[Union[Error, SandboxLogs]]:
"""Get sandbox logs
Args:
@@ -84,7 +88,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Union[Any, SandboxLogs]]
+ Response[Union[Error, SandboxLogs]]
"""
kwargs = _get_kwargs(
@@ -106,7 +110,7 @@ def sync(
client: AuthenticatedClient,
start: Union[Unset, int] = UNSET,
limit: Union[Unset, int] = 1000,
-) -> Optional[Union[Any, SandboxLogs]]:
+) -> Optional[Union[Error, SandboxLogs]]:
"""Get sandbox logs
Args:
@@ -119,7 +123,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Union[Any, SandboxLogs]
+ Union[Error, SandboxLogs]
"""
return sync_detailed(
@@ -136,7 +140,7 @@ async def asyncio_detailed(
client: AuthenticatedClient,
start: Union[Unset, int] = UNSET,
limit: Union[Unset, int] = 1000,
-) -> Response[Union[Any, SandboxLogs]]:
+) -> Response[Union[Error, SandboxLogs]]:
"""Get sandbox logs
Args:
@@ -149,7 +153,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Union[Any, SandboxLogs]]
+ Response[Union[Error, SandboxLogs]]
"""
kwargs = _get_kwargs(
@@ -169,7 +173,7 @@ async def asyncio(
client: AuthenticatedClient,
start: Union[Unset, int] = UNSET,
limit: Union[Unset, int] = 1000,
-) -> Optional[Union[Any, SandboxLogs]]:
+) -> Optional[Union[Error, SandboxLogs]]:
"""Get sandbox logs
Args:
@@ -182,7 +186,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Union[Any, SandboxLogs]
+ Union[Error, SandboxLogs]
"""
return (
diff --git a/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes_sandbox_id_metrics.py b/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes_sandbox_id_metrics.py
index 76905092d..0ce53aa30 100644
--- a/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes_sandbox_id_metrics.py
+++ b/packages/python-sdk/e2b/api/client/api/sandboxes/get_sandboxes_sandbox_id_metrics.py
@@ -1,10 +1,11 @@
from http import HTTPStatus
-from typing import Any, Optional, Union, cast
+from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
+from ...models.error import Error
from ...models.sandbox_metric import SandboxMetric
from ...types import Response
@@ -22,7 +23,7 @@ def _get_kwargs(
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
-) -> Optional[Union[Any, list["SandboxMetric"]]]:
+) -> Optional[Union[Error, list["SandboxMetric"]]]:
if response.status_code == 200:
response_200 = []
_response_200 = response.json()
@@ -33,13 +34,16 @@ def _parse_response(
return response_200
if response.status_code == 401:
- response_401 = cast(Any, None)
+ response_401 = Error.from_dict(response.json())
+
return response_401
if response.status_code == 404:
- response_404 = cast(Any, None)
+ response_404 = Error.from_dict(response.json())
+
return response_404
if response.status_code == 500:
- response_500 = cast(Any, None)
+ response_500 = Error.from_dict(response.json())
+
return response_500
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
@@ -49,7 +53,7 @@ def _parse_response(
def _build_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
-) -> Response[Union[Any, list["SandboxMetric"]]]:
+) -> Response[Union[Error, list["SandboxMetric"]]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
@@ -62,7 +66,7 @@ def sync_detailed(
sandbox_id: str,
*,
client: AuthenticatedClient,
-) -> Response[Union[Any, list["SandboxMetric"]]]:
+) -> Response[Union[Error, list["SandboxMetric"]]]:
"""Get sandbox metrics
Args:
@@ -73,7 +77,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Union[Any, list['SandboxMetric']]]
+ Response[Union[Error, list['SandboxMetric']]]
"""
kwargs = _get_kwargs(
@@ -91,7 +95,7 @@ def sync(
sandbox_id: str,
*,
client: AuthenticatedClient,
-) -> Optional[Union[Any, list["SandboxMetric"]]]:
+) -> Optional[Union[Error, list["SandboxMetric"]]]:
"""Get sandbox metrics
Args:
@@ -102,7 +106,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Union[Any, list['SandboxMetric']]
+ Union[Error, list['SandboxMetric']]
"""
return sync_detailed(
@@ -115,7 +119,7 @@ async def asyncio_detailed(
sandbox_id: str,
*,
client: AuthenticatedClient,
-) -> Response[Union[Any, list["SandboxMetric"]]]:
+) -> Response[Union[Error, list["SandboxMetric"]]]:
"""Get sandbox metrics
Args:
@@ -126,7 +130,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Union[Any, list['SandboxMetric']]]
+ Response[Union[Error, list['SandboxMetric']]]
"""
kwargs = _get_kwargs(
@@ -142,7 +146,7 @@ async def asyncio(
sandbox_id: str,
*,
client: AuthenticatedClient,
-) -> Optional[Union[Any, list["SandboxMetric"]]]:
+) -> Optional[Union[Error, list["SandboxMetric"]]]:
"""Get sandbox metrics
Args:
@@ -153,7 +157,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Union[Any, list['SandboxMetric']]
+ Union[Error, list['SandboxMetric']]
"""
return (
diff --git a/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes.py b/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes.py
index 0a4000b74..557dcdc9a 100644
--- a/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes.py
+++ b/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes.py
@@ -1,10 +1,11 @@
from http import HTTPStatus
-from typing import Any, Optional, Union, cast
+from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
+from ...models.error import Error
from ...models.new_sandbox import NewSandbox
from ...models.sandbox import Sandbox
from ...types import Response
@@ -32,19 +33,22 @@ def _get_kwargs(
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
-) -> Optional[Union[Any, Sandbox]]:
+) -> Optional[Union[Error, Sandbox]]:
if response.status_code == 201:
response_201 = Sandbox.from_dict(response.json())
return response_201
if response.status_code == 400:
- response_400 = cast(Any, None)
+ response_400 = Error.from_dict(response.json())
+
return response_400
if response.status_code == 401:
- response_401 = cast(Any, None)
+ response_401 = Error.from_dict(response.json())
+
return response_401
if response.status_code == 500:
- response_500 = cast(Any, None)
+ response_500 = Error.from_dict(response.json())
+
return response_500
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
@@ -54,7 +58,7 @@ def _parse_response(
def _build_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
-) -> Response[Union[Any, Sandbox]]:
+) -> Response[Union[Error, Sandbox]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
@@ -67,7 +71,7 @@ def sync_detailed(
*,
client: AuthenticatedClient,
body: NewSandbox,
-) -> Response[Union[Any, Sandbox]]:
+) -> Response[Union[Error, Sandbox]]:
"""Create a sandbox from the template
Args:
@@ -78,7 +82,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Union[Any, Sandbox]]
+ Response[Union[Error, Sandbox]]
"""
kwargs = _get_kwargs(
@@ -96,7 +100,7 @@ def sync(
*,
client: AuthenticatedClient,
body: NewSandbox,
-) -> Optional[Union[Any, Sandbox]]:
+) -> Optional[Union[Error, Sandbox]]:
"""Create a sandbox from the template
Args:
@@ -107,7 +111,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Union[Any, Sandbox]
+ Union[Error, Sandbox]
"""
return sync_detailed(
@@ -120,7 +124,7 @@ async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: NewSandbox,
-) -> Response[Union[Any, Sandbox]]:
+) -> Response[Union[Error, Sandbox]]:
"""Create a sandbox from the template
Args:
@@ -131,7 +135,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Union[Any, Sandbox]]
+ Response[Union[Error, Sandbox]]
"""
kwargs = _get_kwargs(
@@ -147,7 +151,7 @@ async def asyncio(
*,
client: AuthenticatedClient,
body: NewSandbox,
-) -> Optional[Union[Any, Sandbox]]:
+) -> Optional[Union[Error, Sandbox]]:
"""Create a sandbox from the template
Args:
@@ -158,7 +162,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Union[Any, Sandbox]
+ Union[Error, Sandbox]
"""
return (
diff --git a/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_pause.py b/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_pause.py
index 8635ebc60..f1c55c62f 100644
--- a/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_pause.py
+++ b/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_pause.py
@@ -1,10 +1,11 @@
from http import HTTPStatus
-from typing import Any, Optional, Union
+from typing import Any, Optional, Union, cast
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
+from ...models.error import Error
from ...types import Response
@@ -19,24 +20,37 @@ def _get_kwargs(
return _kwargs
-def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
+def _parse_response(
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
+) -> Optional[Union[Any, Error]]:
if response.status_code == 204:
- return None
+ response_204 = cast(Any, None)
+ return response_204
if response.status_code == 401:
- return None
+ response_401 = Error.from_dict(response.json())
+
+ return response_401
if response.status_code == 404:
- return None
+ response_404 = Error.from_dict(response.json())
+
+ return response_404
if response.status_code == 409:
- return None
+ response_409 = Error.from_dict(response.json())
+
+ return response_409
if response.status_code == 500:
- return None
+ response_500 = Error.from_dict(response.json())
+
+ return response_500
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
-def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
+def _build_response(
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
+) -> Response[Union[Any, Error]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
@@ -49,7 +63,7 @@ def sync_detailed(
sandbox_id: str,
*,
client: AuthenticatedClient,
-) -> Response[Any]:
+) -> Response[Union[Any, Error]]:
"""Pause the sandbox
Args:
@@ -60,7 +74,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Any]
+ Response[Union[Any, Error]]
"""
kwargs = _get_kwargs(
@@ -74,11 +88,35 @@ def sync_detailed(
return _build_response(client=client, response=response)
+def sync(
+ sandbox_id: str,
+ *,
+ client: AuthenticatedClient,
+) -> Optional[Union[Any, Error]]:
+ """Pause the sandbox
+
+ Args:
+ sandbox_id (str):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Union[Any, Error]
+ """
+
+ return sync_detailed(
+ sandbox_id=sandbox_id,
+ client=client,
+ ).parsed
+
+
async def asyncio_detailed(
sandbox_id: str,
*,
client: AuthenticatedClient,
-) -> Response[Any]:
+) -> Response[Union[Any, Error]]:
"""Pause the sandbox
Args:
@@ -89,7 +127,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Any]
+ Response[Union[Any, Error]]
"""
kwargs = _get_kwargs(
@@ -99,3 +137,29 @@ async def asyncio_detailed(
response = await client.get_async_httpx_client().request(**kwargs)
return _build_response(client=client, response=response)
+
+
+async def asyncio(
+ sandbox_id: str,
+ *,
+ client: AuthenticatedClient,
+) -> Optional[Union[Any, Error]]:
+ """Pause the sandbox
+
+ Args:
+ sandbox_id (str):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Union[Any, Error]
+ """
+
+ return (
+ await asyncio_detailed(
+ sandbox_id=sandbox_id,
+ client=client,
+ )
+ ).parsed
diff --git a/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_refreshes.py b/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_refreshes.py
index ab90668d1..6dd76cedc 100644
--- a/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_refreshes.py
+++ b/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_refreshes.py
@@ -1,11 +1,14 @@
from http import HTTPStatus
-from typing import Any, Optional, Union
+from typing import Any, Optional, Union, cast
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
-from ...models.post_sandboxes_sandbox_id_refreshes_body import PostSandboxesSandboxIDRefreshesBody
+from ...models.error import Error
+from ...models.post_sandboxes_sandbox_id_refreshes_body import (
+ PostSandboxesSandboxIDRefreshesBody,
+)
from ...types import Response
@@ -30,20 +33,29 @@ def _get_kwargs(
return _kwargs
-def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
+def _parse_response(
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
+) -> Optional[Union[Any, Error]]:
if response.status_code == 204:
- return None
+ response_204 = cast(Any, None)
+ return response_204
if response.status_code == 401:
- return None
+ response_401 = Error.from_dict(response.json())
+
+ return response_401
if response.status_code == 404:
- return None
+ response_404 = Error.from_dict(response.json())
+
+ return response_404
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
-def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
+def _build_response(
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
+) -> Response[Union[Any, Error]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
@@ -57,7 +69,7 @@ def sync_detailed(
*,
client: AuthenticatedClient,
body: PostSandboxesSandboxIDRefreshesBody,
-) -> Response[Any]:
+) -> Response[Union[Any, Error]]:
"""Refresh the sandbox extending its time to live
Args:
@@ -69,7 +81,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Any]
+ Response[Union[Any, Error]]
"""
kwargs = _get_kwargs(
@@ -84,12 +96,39 @@ def sync_detailed(
return _build_response(client=client, response=response)
+def sync(
+ sandbox_id: str,
+ *,
+ client: AuthenticatedClient,
+ body: PostSandboxesSandboxIDRefreshesBody,
+) -> Optional[Union[Any, Error]]:
+ """Refresh the sandbox extending its time to live
+
+ Args:
+ sandbox_id (str):
+ body (PostSandboxesSandboxIDRefreshesBody):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Union[Any, Error]
+ """
+
+ return sync_detailed(
+ sandbox_id=sandbox_id,
+ client=client,
+ body=body,
+ ).parsed
+
+
async def asyncio_detailed(
sandbox_id: str,
*,
client: AuthenticatedClient,
body: PostSandboxesSandboxIDRefreshesBody,
-) -> Response[Any]:
+) -> Response[Union[Any, Error]]:
"""Refresh the sandbox extending its time to live
Args:
@@ -101,7 +140,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Any]
+ Response[Union[Any, Error]]
"""
kwargs = _get_kwargs(
@@ -112,3 +151,32 @@ async def asyncio_detailed(
response = await client.get_async_httpx_client().request(**kwargs)
return _build_response(client=client, response=response)
+
+
+async def asyncio(
+ sandbox_id: str,
+ *,
+ client: AuthenticatedClient,
+ body: PostSandboxesSandboxIDRefreshesBody,
+) -> Optional[Union[Any, Error]]:
+ """Refresh the sandbox extending its time to live
+
+ Args:
+ sandbox_id (str):
+ body (PostSandboxesSandboxIDRefreshesBody):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Union[Any, Error]
+ """
+
+ return (
+ await asyncio_detailed(
+ sandbox_id=sandbox_id,
+ client=client,
+ body=body,
+ )
+ ).parsed
diff --git a/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_resume.py b/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_resume.py
index c50fc9c07..6f15b483c 100644
--- a/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_resume.py
+++ b/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_resume.py
@@ -1,10 +1,11 @@
from http import HTTPStatus
-from typing import Any, Optional, Union, cast
+from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
+from ...models.error import Error
from ...models.resumed_sandbox import ResumedSandbox
from ...models.sandbox import Sandbox
from ...types import Response
@@ -33,22 +34,26 @@ def _get_kwargs(
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
-) -> Optional[Union[Any, Sandbox]]:
+) -> Optional[Union[Error, Sandbox]]:
if response.status_code == 201:
response_201 = Sandbox.from_dict(response.json())
return response_201
if response.status_code == 401:
- response_401 = cast(Any, None)
+ response_401 = Error.from_dict(response.json())
+
return response_401
if response.status_code == 404:
- response_404 = cast(Any, None)
+ response_404 = Error.from_dict(response.json())
+
return response_404
if response.status_code == 409:
- response_409 = cast(Any, None)
+ response_409 = Error.from_dict(response.json())
+
return response_409
if response.status_code == 500:
- response_500 = cast(Any, None)
+ response_500 = Error.from_dict(response.json())
+
return response_500
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
@@ -58,7 +63,7 @@ def _parse_response(
def _build_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
-) -> Response[Union[Any, Sandbox]]:
+) -> Response[Union[Error, Sandbox]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
@@ -72,7 +77,7 @@ def sync_detailed(
*,
client: AuthenticatedClient,
body: ResumedSandbox,
-) -> Response[Union[Any, Sandbox]]:
+) -> Response[Union[Error, Sandbox]]:
"""Resume the sandbox
Args:
@@ -84,7 +89,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Union[Any, Sandbox]]
+ Response[Union[Error, Sandbox]]
"""
kwargs = _get_kwargs(
@@ -104,7 +109,7 @@ def sync(
*,
client: AuthenticatedClient,
body: ResumedSandbox,
-) -> Optional[Union[Any, Sandbox]]:
+) -> Optional[Union[Error, Sandbox]]:
"""Resume the sandbox
Args:
@@ -116,7 +121,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Union[Any, Sandbox]
+ Union[Error, Sandbox]
"""
return sync_detailed(
@@ -131,7 +136,7 @@ async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: ResumedSandbox,
-) -> Response[Union[Any, Sandbox]]:
+) -> Response[Union[Error, Sandbox]]:
"""Resume the sandbox
Args:
@@ -143,7 +148,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Union[Any, Sandbox]]
+ Response[Union[Error, Sandbox]]
"""
kwargs = _get_kwargs(
@@ -161,7 +166,7 @@ async def asyncio(
*,
client: AuthenticatedClient,
body: ResumedSandbox,
-) -> Optional[Union[Any, Sandbox]]:
+) -> Optional[Union[Error, Sandbox]]:
"""Resume the sandbox
Args:
@@ -173,7 +178,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Union[Any, Sandbox]
+ Union[Error, Sandbox]
"""
return (
diff --git a/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_timeout.py b/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_timeout.py
index 63beecdcb..18642da6b 100644
--- a/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_timeout.py
+++ b/packages/python-sdk/e2b/api/client/api/sandboxes/post_sandboxes_sandbox_id_timeout.py
@@ -1,11 +1,14 @@
from http import HTTPStatus
-from typing import Any, Optional, Union
+from typing import Any, Optional, Union, cast
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
-from ...models.post_sandboxes_sandbox_id_timeout_body import PostSandboxesSandboxIDTimeoutBody
+from ...models.error import Error
+from ...models.post_sandboxes_sandbox_id_timeout_body import (
+ PostSandboxesSandboxIDTimeoutBody,
+)
from ...types import Response
@@ -30,22 +33,33 @@ def _get_kwargs(
return _kwargs
-def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
+def _parse_response(
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
+) -> Optional[Union[Any, Error]]:
if response.status_code == 204:
- return None
+ response_204 = cast(Any, None)
+ return response_204
if response.status_code == 401:
- return None
+ response_401 = Error.from_dict(response.json())
+
+ return response_401
if response.status_code == 404:
- return None
+ response_404 = Error.from_dict(response.json())
+
+ return response_404
if response.status_code == 500:
- return None
+ response_500 = Error.from_dict(response.json())
+
+ return response_500
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
-def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
+def _build_response(
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
+) -> Response[Union[Any, Error]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
@@ -59,7 +73,7 @@ def sync_detailed(
*,
client: AuthenticatedClient,
body: PostSandboxesSandboxIDTimeoutBody,
-) -> Response[Any]:
+) -> Response[Union[Any, Error]]:
"""Set the timeout for the sandbox. The sandbox will expire x seconds from the time of the request.
Calling this method multiple times overwrites the TTL, each time using the current timestamp as the
starting point to measure the timeout duration.
@@ -73,7 +87,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Any]
+ Response[Union[Any, Error]]
"""
kwargs = _get_kwargs(
@@ -88,12 +102,41 @@ def sync_detailed(
return _build_response(client=client, response=response)
+def sync(
+ sandbox_id: str,
+ *,
+ client: AuthenticatedClient,
+ body: PostSandboxesSandboxIDTimeoutBody,
+) -> Optional[Union[Any, Error]]:
+ """Set the timeout for the sandbox. The sandbox will expire x seconds from the time of the request.
+ Calling this method multiple times overwrites the TTL, each time using the current timestamp as the
+ starting point to measure the timeout duration.
+
+ Args:
+ sandbox_id (str):
+ body (PostSandboxesSandboxIDTimeoutBody):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Union[Any, Error]
+ """
+
+ return sync_detailed(
+ sandbox_id=sandbox_id,
+ client=client,
+ body=body,
+ ).parsed
+
+
async def asyncio_detailed(
sandbox_id: str,
*,
client: AuthenticatedClient,
body: PostSandboxesSandboxIDTimeoutBody,
-) -> Response[Any]:
+) -> Response[Union[Any, Error]]:
"""Set the timeout for the sandbox. The sandbox will expire x seconds from the time of the request.
Calling this method multiple times overwrites the TTL, each time using the current timestamp as the
starting point to measure the timeout duration.
@@ -107,7 +150,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
- Response[Any]
+ Response[Union[Any, Error]]
"""
kwargs = _get_kwargs(
@@ -118,3 +161,34 @@ async def asyncio_detailed(
response = await client.get_async_httpx_client().request(**kwargs)
return _build_response(client=client, response=response)
+
+
+async def asyncio(
+ sandbox_id: str,
+ *,
+ client: AuthenticatedClient,
+ body: PostSandboxesSandboxIDTimeoutBody,
+) -> Optional[Union[Any, Error]]:
+ """Set the timeout for the sandbox. The sandbox will expire x seconds from the time of the request.
+ Calling this method multiple times overwrites the TTL, each time using the current timestamp as the
+ starting point to measure the timeout duration.
+
+ Args:
+ sandbox_id (str):
+ body (PostSandboxesSandboxIDTimeoutBody):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Union[Any, Error]
+ """
+
+ return (
+ await asyncio_detailed(
+ sandbox_id=sandbox_id,
+ client=client,
+ body=body,
+ )
+ ).parsed
diff --git a/packages/python-sdk/e2b/api/client/client.py b/packages/python-sdk/e2b/api/client/client.py
index e80446f10..eeffd00c8 100644
--- a/packages/python-sdk/e2b/api/client/client.py
+++ b/packages/python-sdk/e2b/api/client/client.py
@@ -38,9 +38,15 @@ class Client:
_base_url: str = field(alias="base_url")
_cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies")
_headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers")
- _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout")
- _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl")
- _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects")
+ _timeout: Optional[httpx.Timeout] = field(
+ default=None, kw_only=True, alias="timeout"
+ )
+ _verify_ssl: Union[str, bool, ssl.SSLContext] = field(
+ default=True, kw_only=True, alias="verify_ssl"
+ )
+ _follow_redirects: bool = field(
+ default=False, kw_only=True, alias="follow_redirects"
+ )
_httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args")
_client: Optional[httpx.Client] = field(default=None, init=False)
_async_client: Optional[httpx.AsyncClient] = field(default=None, init=False)
@@ -168,9 +174,15 @@ class AuthenticatedClient:
_base_url: str = field(alias="base_url")
_cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies")
_headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers")
- _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout")
- _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl")
- _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects")
+ _timeout: Optional[httpx.Timeout] = field(
+ default=None, kw_only=True, alias="timeout"
+ )
+ _verify_ssl: Union[str, bool, ssl.SSLContext] = field(
+ default=True, kw_only=True, alias="verify_ssl"
+ )
+ _follow_redirects: bool = field(
+ default=False, kw_only=True, alias="follow_redirects"
+ )
_httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args")
_client: Optional[httpx.Client] = field(default=None, init=False)
_async_client: Optional[httpx.AsyncClient] = field(default=None, init=False)
@@ -214,7 +226,9 @@ class AuthenticatedClient:
def get_httpx_client(self) -> httpx.Client:
"""Get the underlying httpx.Client, constructing a new one if not previously set"""
if self._client is None:
- self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token
+ self._headers[self.auth_header_name] = (
+ f"{self.prefix} {self.token}" if self.prefix else self.token
+ )
self._client = httpx.Client(
base_url=self._base_url,
cookies=self._cookies,
@@ -235,7 +249,9 @@ class AuthenticatedClient:
"""Exit a context manager for internal httpx.Client (see httpx docs)"""
self.get_httpx_client().__exit__(*args, **kwargs)
- def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient":
+ def set_async_httpx_client(
+ self, async_client: httpx.AsyncClient
+ ) -> "AuthenticatedClient":
"""Manually the underlying httpx.AsyncClient
**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
@@ -246,7 +262,9 @@ class AuthenticatedClient:
def get_async_httpx_client(self) -> httpx.AsyncClient:
"""Get the underlying httpx.AsyncClient, constructing a new one if not previously set"""
if self._async_client is None:
- self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token
+ self._headers[self.auth_header_name] = (
+ f"{self.prefix} {self.token}" if self.prefix else self.token
+ )
self._async_client = httpx.AsyncClient(
base_url=self._base_url,
cookies=self._cookies,
diff --git a/packages/python-sdk/e2b/api/client/models/__init__.py b/packages/python-sdk/e2b/api/client/models/__init__.py
index 017a40937..1041b2ba3 100644
--- a/packages/python-sdk/e2b/api/client/models/__init__.py
+++ b/packages/python-sdk/e2b/api/client/models/__init__.py
@@ -10,7 +10,9 @@ from .node import Node
from .node_detail import NodeDetail
from .node_status import NodeStatus
from .node_status_change import NodeStatusChange
-from .post_sandboxes_sandbox_id_refreshes_body import PostSandboxesSandboxIDRefreshesBody
+from .post_sandboxes_sandbox_id_refreshes_body import (
+ PostSandboxesSandboxIDRefreshesBody,
+)
from .post_sandboxes_sandbox_id_timeout_body import PostSandboxesSandboxIDTimeoutBody
from .resumed_sandbox import ResumedSandbox
from .running_sandbox import RunningSandbox
diff --git a/packages/python-sdk/e2b/api/client/models/created_access_token.py b/packages/python-sdk/e2b/api/client/models/created_access_token.py
index 31f22a3c0..beb225edb 100644
--- a/packages/python-sdk/e2b/api/client/models/created_access_token.py
+++ b/packages/python-sdk/e2b/api/client/models/created_access_token.py
@@ -1,4 +1,5 @@
import datetime
+from collections.abc import Mapping
from typing import Any, TypeVar
from uuid import UUID
@@ -53,8 +54,8 @@ class CreatedAccessToken:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
created_at = isoparse(d.pop("createdAt"))
id = UUID(d.pop("id"))
diff --git a/packages/python-sdk/e2b/api/client/models/created_team_api_key.py b/packages/python-sdk/e2b/api/client/models/created_team_api_key.py
index 3a6f2aa2b..55a2a88cc 100644
--- a/packages/python-sdk/e2b/api/client/models/created_team_api_key.py
+++ b/packages/python-sdk/e2b/api/client/models/created_team_api_key.py
@@ -1,4 +1,5 @@
import datetime
+from collections.abc import Mapping
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
from uuid import UUID
@@ -77,10 +78,10 @@ class CreatedTeamAPIKey:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
from ..models.team_user import TeamUser
- d = src_dict.copy()
+ d = dict(src_dict)
created_at = isoparse(d.pop("createdAt"))
def _parse_created_by(data: object) -> Union["TeamUser", None]:
diff --git a/packages/python-sdk/e2b/api/client/models/error.py b/packages/python-sdk/e2b/api/client/models/error.py
index 1dcf14741..362b4361e 100644
--- a/packages/python-sdk/e2b/api/client/models/error.py
+++ b/packages/python-sdk/e2b/api/client/models/error.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import Any, TypeVar
from attrs import define as _attrs_define
@@ -35,8 +36,8 @@ class Error:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
code = d.pop("code")
message = d.pop("message")
diff --git a/packages/python-sdk/e2b/api/client/models/new_access_token.py b/packages/python-sdk/e2b/api/client/models/new_access_token.py
index 18cfb30b5..642dac80d 100644
--- a/packages/python-sdk/e2b/api/client/models/new_access_token.py
+++ b/packages/python-sdk/e2b/api/client/models/new_access_token.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import Any, TypeVar
from attrs import define as _attrs_define
@@ -30,8 +31,8 @@ class NewAccessToken:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
name = d.pop("name")
new_access_token = cls(
diff --git a/packages/python-sdk/e2b/api/client/models/new_sandbox.py b/packages/python-sdk/e2b/api/client/models/new_sandbox.py
index aa79cac3f..e4f1e22e7 100644
--- a/packages/python-sdk/e2b/api/client/models/new_sandbox.py
+++ b/packages/python-sdk/e2b/api/client/models/new_sandbox.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import Any, TypeVar, Union
from attrs import define as _attrs_define
@@ -56,8 +57,8 @@ class NewSandbox:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
template_id = d.pop("templateID")
auto_pause = d.pop("autoPause", UNSET)
diff --git a/packages/python-sdk/e2b/api/client/models/new_team_api_key.py b/packages/python-sdk/e2b/api/client/models/new_team_api_key.py
index f6826f59c..2fac8a6bf 100644
--- a/packages/python-sdk/e2b/api/client/models/new_team_api_key.py
+++ b/packages/python-sdk/e2b/api/client/models/new_team_api_key.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import Any, TypeVar
from attrs import define as _attrs_define
@@ -30,8 +31,8 @@ class NewTeamAPIKey:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
name = d.pop("name")
new_team_api_key = cls(
diff --git a/packages/python-sdk/e2b/api/client/models/node.py b/packages/python-sdk/e2b/api/client/models/node.py
index 40b951047..a0450c815 100644
--- a/packages/python-sdk/e2b/api/client/models/node.py
+++ b/packages/python-sdk/e2b/api/client/models/node.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import Any, TypeVar
from attrs import define as _attrs_define
@@ -62,8 +63,8 @@ class Node:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
allocated_cpu = d.pop("allocatedCPU")
allocated_memory_mi_b = d.pop("allocatedMemoryMiB")
diff --git a/packages/python-sdk/e2b/api/client/models/node_detail.py b/packages/python-sdk/e2b/api/client/models/node_detail.py
index 91a1c738f..cf798042b 100644
--- a/packages/python-sdk/e2b/api/client/models/node_detail.py
+++ b/packages/python-sdk/e2b/api/client/models/node_detail.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import TYPE_CHECKING, Any, TypeVar, cast
from attrs import define as _attrs_define
@@ -59,10 +60,10 @@ class NodeDetail:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
from ..models.running_sandbox import RunningSandbox
- d = src_dict.copy()
+ d = dict(src_dict)
cached_builds = cast(list[str], d.pop("cachedBuilds"))
create_fails = d.pop("createFails")
diff --git a/packages/python-sdk/e2b/api/client/models/node_status_change.py b/packages/python-sdk/e2b/api/client/models/node_status_change.py
index c22453be2..35ec53584 100644
--- a/packages/python-sdk/e2b/api/client/models/node_status_change.py
+++ b/packages/python-sdk/e2b/api/client/models/node_status_change.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import Any, TypeVar
from attrs import define as _attrs_define
@@ -32,8 +33,8 @@ class NodeStatusChange:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
status = NodeStatus(d.pop("status"))
node_status_change = cls(
diff --git a/packages/python-sdk/e2b/api/client/models/post_sandboxes_sandbox_id_refreshes_body.py b/packages/python-sdk/e2b/api/client/models/post_sandboxes_sandbox_id_refreshes_body.py
index 5cb0807cf..5a35d2612 100644
--- a/packages/python-sdk/e2b/api/client/models/post_sandboxes_sandbox_id_refreshes_body.py
+++ b/packages/python-sdk/e2b/api/client/models/post_sandboxes_sandbox_id_refreshes_body.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import Any, TypeVar, Union
from attrs import define as _attrs_define
@@ -30,8 +31,8 @@ class PostSandboxesSandboxIDRefreshesBody:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
duration = d.pop("duration", UNSET)
post_sandboxes_sandbox_id_refreshes_body = cls(
diff --git a/packages/python-sdk/e2b/api/client/models/post_sandboxes_sandbox_id_timeout_body.py b/packages/python-sdk/e2b/api/client/models/post_sandboxes_sandbox_id_timeout_body.py
index 77907033b..4d06c65f6 100644
--- a/packages/python-sdk/e2b/api/client/models/post_sandboxes_sandbox_id_timeout_body.py
+++ b/packages/python-sdk/e2b/api/client/models/post_sandboxes_sandbox_id_timeout_body.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import Any, TypeVar
from attrs import define as _attrs_define
@@ -30,8 +31,8 @@ class PostSandboxesSandboxIDTimeoutBody:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
timeout = d.pop("timeout")
post_sandboxes_sandbox_id_timeout_body = cls(
diff --git a/packages/python-sdk/e2b/api/client/models/resumed_sandbox.py b/packages/python-sdk/e2b/api/client/models/resumed_sandbox.py
index c8481750b..568b7ef2a 100644
--- a/packages/python-sdk/e2b/api/client/models/resumed_sandbox.py
+++ b/packages/python-sdk/e2b/api/client/models/resumed_sandbox.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import Any, TypeVar, Union
from attrs import define as _attrs_define
@@ -36,8 +37,8 @@ class ResumedSandbox:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
auto_pause = d.pop("autoPause", UNSET)
timeout = d.pop("timeout", UNSET)
diff --git a/packages/python-sdk/e2b/api/client/models/running_sandbox.py b/packages/python-sdk/e2b/api/client/models/running_sandbox.py
index f4b2d772d..6e87cc34f 100644
--- a/packages/python-sdk/e2b/api/client/models/running_sandbox.py
+++ b/packages/python-sdk/e2b/api/client/models/running_sandbox.py
@@ -1,4 +1,5 @@
import datetime
+from collections.abc import Mapping
from typing import Any, TypeVar, Union
from attrs import define as _attrs_define
@@ -76,8 +77,8 @@ class RunningSandbox:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
client_id = d.pop("clientID")
cpu_count = d.pop("cpuCount")
diff --git a/packages/python-sdk/e2b/api/client/models/running_sandbox_with_metrics.py b/packages/python-sdk/e2b/api/client/models/running_sandbox_with_metrics.py
index 95925acac..e4b360f90 100644
--- a/packages/python-sdk/e2b/api/client/models/running_sandbox_with_metrics.py
+++ b/packages/python-sdk/e2b/api/client/models/running_sandbox_with_metrics.py
@@ -1,4 +1,5 @@
import datetime
+from collections.abc import Mapping
from typing import TYPE_CHECKING, Any, TypeVar, Union
from attrs import define as _attrs_define
@@ -91,10 +92,10 @@ class RunningSandboxWithMetrics:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
from ..models.sandbox_metric import SandboxMetric
- d = src_dict.copy()
+ d = dict(src_dict)
client_id = d.pop("clientID")
cpu_count = d.pop("cpuCount")
diff --git a/packages/python-sdk/e2b/api/client/models/sandbox.py b/packages/python-sdk/e2b/api/client/models/sandbox.py
index 3514d71b1..12ed6341e 100644
--- a/packages/python-sdk/e2b/api/client/models/sandbox.py
+++ b/packages/python-sdk/e2b/api/client/models/sandbox.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import Any, TypeVar, Union
from attrs import define as _attrs_define
@@ -53,8 +54,8 @@ class Sandbox:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
client_id = d.pop("clientID")
envd_version = d.pop("envdVersion")
diff --git a/packages/python-sdk/e2b/api/client/models/sandbox_log.py b/packages/python-sdk/e2b/api/client/models/sandbox_log.py
index ea192436d..65b9144ef 100644
--- a/packages/python-sdk/e2b/api/client/models/sandbox_log.py
+++ b/packages/python-sdk/e2b/api/client/models/sandbox_log.py
@@ -1,4 +1,5 @@
import datetime
+from collections.abc import Mapping
from typing import Any, TypeVar
from attrs import define as _attrs_define
@@ -38,8 +39,8 @@ class SandboxLog:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
line = d.pop("line")
timestamp = isoparse(d.pop("timestamp"))
diff --git a/packages/python-sdk/e2b/api/client/models/sandbox_logs.py b/packages/python-sdk/e2b/api/client/models/sandbox_logs.py
index 0766a371b..d6af161fb 100644
--- a/packages/python-sdk/e2b/api/client/models/sandbox_logs.py
+++ b/packages/python-sdk/e2b/api/client/models/sandbox_logs.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import TYPE_CHECKING, Any, TypeVar
from attrs import define as _attrs_define
@@ -37,10 +38,10 @@ class SandboxLogs:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
from ..models.sandbox_log import SandboxLog
- d = src_dict.copy()
+ d = dict(src_dict)
logs = []
_logs = d.pop("logs")
for logs_item_data in _logs:
diff --git a/packages/python-sdk/e2b/api/client/models/sandbox_metric.py b/packages/python-sdk/e2b/api/client/models/sandbox_metric.py
index 54cea611c..7526ba933 100644
--- a/packages/python-sdk/e2b/api/client/models/sandbox_metric.py
+++ b/packages/python-sdk/e2b/api/client/models/sandbox_metric.py
@@ -1,4 +1,5 @@
import datetime
+from collections.abc import Mapping
from typing import Any, TypeVar
from attrs import define as _attrs_define
@@ -53,8 +54,8 @@ class SandboxMetric:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
cpu_count = d.pop("cpuCount")
cpu_used_pct = d.pop("cpuUsedPct")
diff --git a/packages/python-sdk/e2b/api/client/models/team.py b/packages/python-sdk/e2b/api/client/models/team.py
index f17cedd14..81a434c14 100644
--- a/packages/python-sdk/e2b/api/client/models/team.py
+++ b/packages/python-sdk/e2b/api/client/models/team.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import Any, TypeVar
from attrs import define as _attrs_define
@@ -45,8 +46,8 @@ class Team:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
api_key = d.pop("apiKey")
is_default = d.pop("isDefault")
diff --git a/packages/python-sdk/e2b/api/client/models/team_api_key.py b/packages/python-sdk/e2b/api/client/models/team_api_key.py
index 9726b6252..d047ad375 100644
--- a/packages/python-sdk/e2b/api/client/models/team_api_key.py
+++ b/packages/python-sdk/e2b/api/client/models/team_api_key.py
@@ -1,4 +1,5 @@
import datetime
+from collections.abc import Mapping
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
from uuid import UUID
@@ -72,10 +73,10 @@ class TeamAPIKey:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
from ..models.team_user import TeamUser
- d = src_dict.copy()
+ d = dict(src_dict)
created_at = isoparse(d.pop("createdAt"))
def _parse_created_by(data: object) -> Union["TeamUser", None]:
diff --git a/packages/python-sdk/e2b/api/client/models/team_user.py b/packages/python-sdk/e2b/api/client/models/team_user.py
index b52b82ab4..cd42f7fc5 100644
--- a/packages/python-sdk/e2b/api/client/models/team_user.py
+++ b/packages/python-sdk/e2b/api/client/models/team_user.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import Any, TypeVar
from uuid import UUID
@@ -36,8 +37,8 @@ class TeamUser:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
email = d.pop("email")
id = UUID(d.pop("id"))
diff --git a/packages/python-sdk/e2b/api/client/models/template.py b/packages/python-sdk/e2b/api/client/models/template.py
index 4c65a62de..58abcbd90 100644
--- a/packages/python-sdk/e2b/api/client/models/template.py
+++ b/packages/python-sdk/e2b/api/client/models/template.py
@@ -1,4 +1,5 @@
import datetime
+from collections.abc import Mapping
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
from attrs import define as _attrs_define
@@ -102,10 +103,10 @@ class Template:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
from ..models.team_user import TeamUser
- d = src_dict.copy()
+ d = dict(src_dict)
build_count = d.pop("buildCount")
build_id = d.pop("buildID")
diff --git a/packages/python-sdk/e2b/api/client/models/template_build.py b/packages/python-sdk/e2b/api/client/models/template_build.py
index 34bb32aae..aecc8cb40 100644
--- a/packages/python-sdk/e2b/api/client/models/template_build.py
+++ b/packages/python-sdk/e2b/api/client/models/template_build.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import Any, TypeVar, cast
from attrs import define as _attrs_define
@@ -47,8 +48,8 @@ class TemplateBuild:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
build_id = d.pop("buildID")
logs = cast(list[str], d.pop("logs"))
diff --git a/packages/python-sdk/e2b/api/client/models/template_build_request.py b/packages/python-sdk/e2b/api/client/models/template_build_request.py
index 18f1fb8f3..71ad19052 100644
--- a/packages/python-sdk/e2b/api/client/models/template_build_request.py
+++ b/packages/python-sdk/e2b/api/client/models/template_build_request.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import Any, TypeVar, Union
from attrs import define as _attrs_define
@@ -62,8 +63,8 @@ class TemplateBuildRequest:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
dockerfile = d.pop("dockerfile")
alias = d.pop("alias", UNSET)
diff --git a/packages/python-sdk/e2b/api/client/models/template_update_request.py b/packages/python-sdk/e2b/api/client/models/template_update_request.py
index 17df72644..8a9f5bee8 100644
--- a/packages/python-sdk/e2b/api/client/models/template_update_request.py
+++ b/packages/python-sdk/e2b/api/client/models/template_update_request.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import Any, TypeVar, Union
from attrs import define as _attrs_define
@@ -30,8 +31,8 @@ class TemplateUpdateRequest:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
public = d.pop("public", UNSET)
template_update_request = cls(
diff --git a/packages/python-sdk/e2b/api/client/models/update_team_api_key.py b/packages/python-sdk/e2b/api/client/models/update_team_api_key.py
index 03bae6c5a..34fb9679a 100644
--- a/packages/python-sdk/e2b/api/client/models/update_team_api_key.py
+++ b/packages/python-sdk/e2b/api/client/models/update_team_api_key.py
@@ -1,3 +1,4 @@
+from collections.abc import Mapping
from typing import Any, TypeVar
from attrs import define as _attrs_define
@@ -30,8 +31,8 @@ class UpdateTeamAPIKey:
return field_dict
@classmethod
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
- d = src_dict.copy()
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
+ d = dict(src_dict)
name = d.pop("name")
update_team_api_key = cls(
diff --git a/packages/python-sdk/e2b/envd/filesystem/filesystem_pb2.py b/packages/python-sdk/e2b/envd/filesystem/filesystem_pb2.py
index 626367ae3..b7e6c5f05 100644
--- a/packages/python-sdk/e2b/envd/filesystem/filesystem_pb2.py
+++ b/packages/python-sdk/e2b/envd/filesystem/filesystem_pb2.py
@@ -2,13 +2,17 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: filesystem/filesystem.proto
-# Protobuf Python Version: 5.28.3
+# Protobuf Python Version: 5.29.3
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
+from google.protobuf import runtime_version as _runtime_version
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
+_runtime_version.ValidateProtobufRuntimeVersion(
+ _runtime_version.Domain.PUBLIC, 5, 29, 3, "", "filesystem/filesystem.proto"
+)
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
diff --git a/packages/python-sdk/e2b/envd/process/process_pb2.py b/packages/python-sdk/e2b/envd/process/process_pb2.py
index 4ef9098da..e5296c582 100644
--- a/packages/python-sdk/e2b/envd/process/process_pb2.py
+++ b/packages/python-sdk/e2b/envd/process/process_pb2.py
@@ -2,13 +2,17 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: process/process.proto
-# Protobuf Python Version: 5.28.3
+# Protobuf Python Version: 5.29.3
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
+from google.protobuf import runtime_version as _runtime_version
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
+_runtime_version.ValidateProtobufRuntimeVersion(
+ _runtime_version.Domain.PUBLIC, 5, 29, 3, "", "process/process.proto"
+)
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
diff --git a/packages/python-sdk/e2b/sandbox/filesystem/filesystem.py b/packages/python-sdk/e2b/sandbox/filesystem/filesystem.py
index 2f6717014..dfa51eeb7 100644
--- a/packages/python-sdk/e2b/sandbox/filesystem/filesystem.py
+++ b/packages/python-sdk/e2b/sandbox/filesystem/filesystem.py
@@ -48,6 +48,8 @@ class EntryInfo:
dataclass
+
+
class WriteEntry:
"""
Contains path and data of the file to be written to the filesystem.
diff --git a/packages/python-sdk/e2b/sandbox_async/commands/command_handle.py b/packages/python-sdk/e2b/sandbox_async/commands/command_handle.py
index f8dafbe0b..dfe34e838 100644
--- a/packages/python-sdk/e2b/sandbox_async/commands/command_handle.py
+++ b/packages/python-sdk/e2b/sandbox_async/commands/command_handle.py
@@ -112,11 +112,11 @@ class AsyncCommandHandle:
async for event in self._events:
if event.event.HasField("data"):
if event.event.data.stdout:
- out = event.event.data.stdout.decode('utf-8', 'replace')
+ out = event.event.data.stdout.decode("utf-8", "replace")
self._stdout += out
yield out, None, None
if event.event.data.stderr:
- out = event.event.data.stderr.decode('utf-8', 'replace')
+ out = event.event.data.stderr.decode("utf-8", "replace")
self._stderr += out
yield None, out, None
if event.event.data.pty:
diff --git a/packages/python-sdk/e2b/sandbox_async/filesystem/filesystem.py b/packages/python-sdk/e2b/sandbox_async/filesystem/filesystem.py
index 318db5e6c..d1871bd70 100644
--- a/packages/python-sdk/e2b/sandbox_async/filesystem/filesystem.py
+++ b/packages/python-sdk/e2b/sandbox_async/filesystem/filesystem.py
@@ -169,7 +169,7 @@ class Filesystem:
"""
Writes multiple files.
- :param files: list of files to write
+ :param files: list of files to write
:param user: Run the operation as this user
:param request_timeout: Timeout for the request
:return: Information about the written files
@@ -180,7 +180,7 @@ class Filesystem:
path_or_files: Union[str, List[WriteEntry]],
data_or_user: Union[str, bytes, IO, Username] = "user",
user_or_request_timeout: Optional[Union[float, Username]] = None,
- request_timeout_or_none: Optional[float] = None
+ request_timeout_or_none: Optional[float] = None,
) -> Union[EntryInfo, List[EntryInfo]]:
"""
Writes content to a file on the path.
@@ -191,31 +191,43 @@ class Filesystem:
path, write_files, user, request_timeout = None, [], "user", None
if isinstance(path_or_files, str):
if isinstance(data_or_user, list):
- raise Exception("Cannot specify both path and array of files. You have to specify either path and data for a single file or an array for multiple files.")
- path, write_files, user, request_timeout = \
- path_or_files, [{"path": path_or_files, "data": data_or_user}], user_or_request_timeout or "user", request_timeout_or_none
+ raise Exception(
+ "Cannot specify both path and array of files. You have to specify either path and data for a single file or an array for multiple files."
+ )
+ path, write_files, user, request_timeout = (
+ path_or_files,
+ [{"path": path_or_files, "data": data_or_user}],
+ user_or_request_timeout or "user",
+ request_timeout_or_none,
+ )
else:
if path_or_files is None:
raise Exception("Path or files are required")
- path, write_files, user, request_timeout = \
- None, path_or_files, data_or_user, user_or_request_timeout
+ path, write_files, user, request_timeout = (
+ None,
+ path_or_files,
+ data_or_user,
+ user_or_request_timeout,
+ )
# Prepare the files for the multipart/form-data request
httpx_files = []
for file in write_files:
- file_path, file_data = file['path'], file['data']
+ file_path, file_data = file["path"], file["data"]
if isinstance(file_data, str) or isinstance(file_data, bytes):
- httpx_files.append(('file', (file_path, file_data)))
- elif isinstance(file_data,IOBase):
- httpx_files.append(('file', (file_path, file_data.read())))
+ httpx_files.append(("file", (file_path, file_data)))
+ elif isinstance(file_data, IOBase):
+ httpx_files.append(("file", (file_path, file_data.read())))
else:
raise ValueError(f"Unsupported data type for file {file_path}")
-
+
# Allow passing empty list of files
- if len(httpx_files) == 0: return []
+ if len(httpx_files) == 0:
+ return []
params = {"username": user}
- if path is not None: params["path"] = path
+ if path is not None:
+ params["path"] = path
r = await self._envd_api.post(
ENVD_API_FILES_ROUTE,
@@ -239,7 +251,6 @@ class Filesystem:
else:
return [EntryInfo(**file) for file in write_files]
-
async def list(
self,
path: str,
diff --git a/packages/python-sdk/e2b/sandbox_async/main.py b/packages/python-sdk/e2b/sandbox_async/main.py
index 998f99000..3db4ccd31 100644
--- a/packages/python-sdk/e2b/sandbox_async/main.py
+++ b/packages/python-sdk/e2b/sandbox_async/main.py
@@ -392,4 +392,4 @@ class AsyncSandbox(SandboxSetup, SandboxApi):
return await SandboxApi.get_info(
sandbox_id=self.sandbox_id,
**self.connection_config.__dict__,
- )
\ No newline at end of file
+ )
diff --git a/packages/python-sdk/e2b/sandbox_async/sandbox_api.py b/packages/python-sdk/e2b/sandbox_async/sandbox_api.py
index e3799b71f..8c235e94f 100644
--- a/packages/python-sdk/e2b/sandbox_async/sandbox_api.py
+++ b/packages/python-sdk/e2b/sandbox_async/sandbox_api.py
@@ -86,7 +86,7 @@ class SandboxApi(SandboxApiBase):
)
for sandbox in res.parsed
]
-
+
@classmethod
async def get_info(
cls,
diff --git a/packages/python-sdk/e2b/sandbox_sync/filesystem/filesystem.py b/packages/python-sdk/e2b/sandbox_sync/filesystem/filesystem.py
index 0cefd7b5a..76c1ab4bf 100644
--- a/packages/python-sdk/e2b/sandbox_sync/filesystem/filesystem.py
+++ b/packages/python-sdk/e2b/sandbox_sync/filesystem/filesystem.py
@@ -171,7 +171,7 @@ class Filesystem:
When writing to a file that already exists, the file will get overwritten.
When writing to a file that's in a directory that doesn't exist, you'll get an error.
- :param files: list of files to write
+ :param files: list of files to write
:param user: Run the operation as this user
:param request_timeout: Timeout for the request
:return: Information about the written files
@@ -182,36 +182,48 @@ class Filesystem:
path_or_files: Union[str, List[WriteEntry]],
data_or_user: Union[str, bytes, IO, Username] = "user",
user_or_request_timeout: Optional[Union[float, Username]] = None,
- request_timeout_or_none: Optional[float] = None
+ request_timeout_or_none: Optional[float] = None,
) -> Union[EntryInfo, List[EntryInfo]]:
- path, write_files, user, request_timeout = None, [], "user", None
+ path, write_files, user, request_timeout = None, [], "user", None
if isinstance(path_or_files, str):
if isinstance(data_or_user, list):
- raise Exception("Cannot specify both path and array of files. You have to specify either path and data for a single file or an array for multiple files.")
- path, write_files, user, request_timeout = \
- path_or_files, [{"path": path_or_files, "data": data_or_user}], user_or_request_timeout or "user", request_timeout_or_none
+ raise Exception(
+ "Cannot specify both path and array of files. You have to specify either path and data for a single file or an array for multiple files."
+ )
+ path, write_files, user, request_timeout = (
+ path_or_files,
+ [{"path": path_or_files, "data": data_or_user}],
+ user_or_request_timeout or "user",
+ request_timeout_or_none,
+ )
else:
if path_or_files is None:
raise Exception("Path or files are required")
- path, write_files, user, request_timeout = \
- None, path_or_files, data_or_user, user_or_request_timeout
-
+ path, write_files, user, request_timeout = (
+ None,
+ path_or_files,
+ data_or_user,
+ user_or_request_timeout,
+ )
+
# Prepare the files for the multipart/form-data request
httpx_files = []
for file in write_files:
- file_path, file_data = file['path'], file['data']
+ file_path, file_data = file["path"], file["data"]
if isinstance(file_data, str) or isinstance(file_data, bytes):
- httpx_files.append(('file', (file_path, file_data)))
+ httpx_files.append(("file", (file_path, file_data)))
elif isinstance(file_data, IOBase):
- httpx_files.append(('file', (file_path, file_data.read())))
+ httpx_files.append(("file", (file_path, file_data.read())))
else:
raise ValueError(f"Unsupported data type for file {file_path}")
-
+
# Allow passing empty list of files
- if len(httpx_files) == 0: return []
+ if len(httpx_files) == 0:
+ return []
params = {"username": user}
- if path is not None: params["path"] = path
+ if path is not None:
+ params["path"] = path
r = self._envd_api.post(
ENVD_API_FILES_ROUTE,
diff --git a/packages/python-sdk/e2b/sandbox_sync/main.py b/packages/python-sdk/e2b/sandbox_sync/main.py
index 2144dd45d..3425bce15 100644
--- a/packages/python-sdk/e2b/sandbox_sync/main.py
+++ b/packages/python-sdk/e2b/sandbox_sync/main.py
@@ -365,7 +365,7 @@ class Sandbox(SandboxSetup, SandboxApi):
def get_info( # type: ignore
self,
request_timeout: Optional[float] = None,
- ) -> SandboxInfo:
+ ) -> SandboxInfo:
"""
Get sandbox information like sandbox ID, template, metadata, started at/end at date.
:param request_timeout: Timeout for the request in **seconds**
@@ -381,4 +381,4 @@ class Sandbox(SandboxSetup, SandboxApi):
return SandboxApi.get_info(
sandbox_id=self.sandbox_id,
**self.connection_config.__dict__,
- )
\ No newline at end of file
+ )
diff --git a/packages/python-sdk/e2b/sandbox_sync/sandbox_api.py b/packages/python-sdk/e2b/sandbox_sync/sandbox_api.py
index 484b7bdb9..3e8e7fdf6 100644
--- a/packages/python-sdk/e2b/sandbox_sync/sandbox_api.py
+++ b/packages/python-sdk/e2b/sandbox_sync/sandbox_api.py
@@ -87,7 +87,7 @@ class SandboxApi(SandboxApiBase):
)
for sandbox in res.parsed
]
-
+
@classmethod
def get_info(
cls,
diff --git a/packages/python-sdk/poetry.lock b/packages/python-sdk/poetry.lock
index 76b160adb..e5ced7fb9 100644
--- a/packages/python-sdk/poetry.lock
+++ b/packages/python-sdk/poetry.lock
@@ -1,4 +1,4 @@
-# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand.
+# This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand.
[[package]]
name = "anyio"
@@ -6,6 +6,7 @@ version = "4.5.2"
description = "High level compatibility layer for multiple asynchronous event loop implementations"
optional = false
python-versions = ">=3.8"
+groups = ["main"]
files = [
{file = "anyio-4.5.2-py3-none-any.whl", hash = "sha256:c011ee36bc1e8ba40e5a81cb9df91925c218fe9b778554e0b56a21e1b5d4716f"},
{file = "anyio-4.5.2.tar.gz", hash = "sha256:23009af4ed04ce05991845451e11ef02fc7c5ed29179ac9a420e5ad0ac7ddc5b"},
@@ -19,7 +20,7 @@ typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""}
[package.extras]
doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"]
-test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"]
+test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1) ; python_version >= \"3.10\"", "uvloop (>=0.21.0b1) ; platform_python_implementation == \"CPython\" and platform_system != \"Windows\""]
trio = ["trio (>=0.26.1)"]
[[package]]
@@ -28,18 +29,19 @@ version = "24.2.0"
description = "Classes Without Boilerplate"
optional = false
python-versions = ">=3.7"
+groups = ["main"]
files = [
{file = "attrs-24.2.0-py3-none-any.whl", hash = "sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2"},
{file = "attrs-24.2.0.tar.gz", hash = "sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346"},
]
[package.extras]
-benchmark = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins", "pytest-xdist[psutil]"]
-cov = ["cloudpickle", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"]
-dev = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"]
+benchmark = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\"", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\" and python_version < \"3.13\"", "pytest-xdist[psutil]"]
+cov = ["cloudpickle ; platform_python_implementation == \"CPython\"", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\"", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\" and python_version < \"3.13\"", "pytest-xdist[psutil]"]
+dev = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\"", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\" and python_version < \"3.13\"", "pytest-xdist[psutil]"]
docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier (<24.7)"]
-tests = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"]
-tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"]
+tests = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\"", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\" and python_version < \"3.13\"", "pytest-xdist[psutil]"]
+tests-mypy = ["mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\"", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.9\" and python_version < \"3.13\""]
[[package]]
name = "black"
@@ -47,6 +49,7 @@ version = "23.12.1"
description = "The uncompromising code formatter."
optional = false
python-versions = ">=3.8"
+groups = ["dev"]
files = [
{file = "black-23.12.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e0aaf6041986767a5e0ce663c7a2f0e9eaf21e6ff87a5f95cbf3675bfd4c41d2"},
{file = "black-23.12.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c88b3711d12905b74206227109272673edce0cb29f27e1385f33b0163c414bba"},
@@ -83,7 +86,7 @@ typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""}
[package.extras]
colorama = ["colorama (>=0.4.3)"]
-d = ["aiohttp (>=3.7.4)", "aiohttp (>=3.7.4,!=3.9.0)"]
+d = ["aiohttp (>=3.7.4) ; sys_platform != \"win32\" or implementation_name != \"pypy\"", "aiohttp (>=3.7.4,!=3.9.0) ; sys_platform == \"win32\" and implementation_name == \"pypy\""]
jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"]
uvloop = ["uvloop (>=0.15.2)"]
@@ -93,6 +96,7 @@ version = "2024.12.14"
description = "Python package for providing Mozilla's CA Bundle."
optional = false
python-versions = ">=3.6"
+groups = ["main", "dev"]
files = [
{file = "certifi-2024.12.14-py3-none-any.whl", hash = "sha256:1275f7a45be9464efc1173084eaa30f866fe2e47d389406136d332ed4967ec56"},
{file = "certifi-2024.12.14.tar.gz", hash = "sha256:b650d30f370c2b724812bee08008be0c4163b163ddaec3f2546c1caf65f191db"},
@@ -104,6 +108,7 @@ version = "3.4.0"
description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
optional = false
python-versions = ">=3.7.0"
+groups = ["dev"]
files = [
{file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:4f9fc98dad6c2eaa32fc3af1417d95b5e3d08aff968df0cd320066def971f9a6"},
{file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0de7b687289d3c1b3e8660d0741874abe7888100efe14bd0f9fd7141bcbda92b"},
@@ -218,6 +223,7 @@ version = "8.1.7"
description = "Composable command line interface toolkit"
optional = false
python-versions = ">=3.7"
+groups = ["dev"]
files = [
{file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"},
{file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"},
@@ -232,6 +238,8 @@ version = "0.4.6"
description = "Cross-platform colored terminal text."
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
+groups = ["dev"]
+markers = "platform_system == \"Windows\" or sys_platform == \"win32\""
files = [
{file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
@@ -243,6 +251,7 @@ version = "4.5.2"
description = "Databind is a library inspired by jackson-databind to de-/serialize Python dataclasses. The `databind` package will install the full suite of databind packages. Compatible with Python 3.8 and newer."
optional = false
python-versions = "<4.0.0,>=3.8.0"
+groups = ["dev"]
files = [
{file = "databind-4.5.2-py3-none-any.whl", hash = "sha256:b9c3a03c0414aa4567f095d7218ac904bd2b267b58e3763dac28e83d64b69770"},
{file = "databind-4.5.2.tar.gz", hash = "sha256:0a8aa0ff130a0306581c559388f5ef65e0fae7ef4b86412eacb1f4a0420006c4"},
@@ -262,6 +271,7 @@ version = "4.5.2"
description = "Databind is a library inspired by jackson-databind to de-/serialize Python dataclasses. Compatible with Python 3.8 and newer. Deprecated, use `databind` package."
optional = false
python-versions = "<4.0.0,>=3.8.0"
+groups = ["dev"]
files = [
{file = "databind.core-4.5.2-py3-none-any.whl", hash = "sha256:a1dd1c6bd8ca9907d1292d8df9ec763ce91543e27f7eda4268e4a1a84fcd1c42"},
{file = "databind.core-4.5.2.tar.gz", hash = "sha256:b8ac8127bc5d6b239a2a81aeddb268b0c4cadd53fbce7e8b2c7a9ef6413bccb3"},
@@ -276,6 +286,7 @@ version = "4.5.2"
description = "De-/serialize Python dataclasses to or from JSON payloads. Compatible with Python 3.8 and newer. Deprecated, use `databind` module instead."
optional = false
python-versions = "<4.0.0,>=3.8.0"
+groups = ["dev"]
files = [
{file = "databind.json-4.5.2-py3-none-any.whl", hash = "sha256:a803bf440634685984361cb2a5a975887e487c854ed48d81ff7aaf3a1ed1e94c"},
{file = "databind.json-4.5.2.tar.gz", hash = "sha256:6cc9b5c6fddaebd49b2433932948eb3be8a41633b90aa37998d7922504b8f165"},
@@ -290,6 +301,7 @@ version = "1.2.14"
description = "Python @deprecated decorator to deprecate old python classes, functions or methods."
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
+groups = ["dev"]
files = [
{file = "Deprecated-1.2.14-py2.py3-none-any.whl", hash = "sha256:6fac8b097794a90302bdbb17b9b815e732d3c4720583ff1b198499d78470466c"},
{file = "Deprecated-1.2.14.tar.gz", hash = "sha256:e5323eb936458dccc2582dc6f9c322c852a775a27065ff2b0c4970b9d53d01b3"},
@@ -307,6 +319,7 @@ version = "2.2.1"
description = "Docspec is a JSON object specification for representing API documentation of programming languages."
optional = false
python-versions = ">=3.7,<4.0"
+groups = ["dev"]
files = [
{file = "docspec-2.2.1-py3-none-any.whl", hash = "sha256:7538f750095a9688c6980ff9a4e029a823a500f64bd00b6b4bdb27951feb31cb"},
{file = "docspec-2.2.1.tar.gz", hash = "sha256:4854e77edc0e2de40e785e57e95880f7095a05fe978f8b54cef7a269586e15ff"},
@@ -323,6 +336,7 @@ version = "2.2.1"
description = "A parser based on lib2to3 producing docspec data from Python source code."
optional = false
python-versions = ">=3.7,<4.0"
+groups = ["dev"]
files = [
{file = "docspec_python-2.2.1-py3-none-any.whl", hash = "sha256:76ac41d35a8face35b2d766c2e8a416fb8832359785d396f0d53bcb00f178e54"},
{file = "docspec_python-2.2.1.tar.gz", hash = "sha256:c41b850b4d6f4de30999ea6f82c9cdb9183d9bcba45559ee9173d3dab7281559"},
@@ -339,6 +353,7 @@ version = "0.11"
description = "\"Parse Python docstrings in reST, Google and Numpydoc format\""
optional = false
python-versions = ">=3.6"
+groups = ["dev"]
files = [
{file = "docstring_parser-0.11.tar.gz", hash = "sha256:93b3f8f481c7d24e37c5d9f30293c89e2933fa209421c8abd731dd3ef0715ecb"},
]
@@ -352,6 +367,8 @@ version = "1.2.2"
description = "Backport of PEP 654 (exception groups)"
optional = false
python-versions = ">=3.7"
+groups = ["main", "dev"]
+markers = "python_version < \"3.11\""
files = [
{file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"},
{file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"},
@@ -366,6 +383,7 @@ version = "2.1.1"
description = "execnet: rapid multi-Python deployment"
optional = false
python-versions = ">=3.8"
+groups = ["dev"]
files = [
{file = "execnet-2.1.1-py3-none-any.whl", hash = "sha256:26dee51f1b80cebd6d0ca8e74dd8745419761d3bef34163928cbebbdc4749fdc"},
{file = "execnet-2.1.1.tar.gz", hash = "sha256:5189b52c6121c24feae288166ab41b32549c7e2348652736540b9e6e7d4e72e3"},
@@ -380,6 +398,7 @@ version = "0.14.0"
description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1"
optional = false
python-versions = ">=3.7"
+groups = ["main"]
files = [
{file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"},
{file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"},
@@ -391,6 +410,7 @@ version = "1.0.6"
description = "A minimal low-level HTTP client."
optional = false
python-versions = ">=3.8"
+groups = ["main"]
files = [
{file = "httpcore-1.0.6-py3-none-any.whl", hash = "sha256:27b59625743b85577a8c0e10e55b50b5368a4f2cfe8cc7bcfa9cf00829c2682f"},
{file = "httpcore-1.0.6.tar.gz", hash = "sha256:73f6dbd6eb8c21bbf7ef8efad555481853f5f6acdeaff1edb0694289269ee17f"},
@@ -412,6 +432,7 @@ version = "0.27.2"
description = "The next generation HTTP client."
optional = false
python-versions = ">=3.8"
+groups = ["main"]
files = [
{file = "httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0"},
{file = "httpx-0.27.2.tar.gz", hash = "sha256:f7c2be1d2f3c3c3160d441802406b206c2b76f5947b11115e6df10c6c65e66c2"},
@@ -425,7 +446,7 @@ idna = "*"
sniffio = "*"
[package.extras]
-brotli = ["brotli", "brotlicffi"]
+brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""]
cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"]
http2 = ["h2 (>=3,<5)"]
socks = ["socksio (==1.*)"]
@@ -437,6 +458,7 @@ version = "3.10"
description = "Internationalized Domain Names in Applications (IDNA)"
optional = false
python-versions = ">=3.6"
+groups = ["main", "dev"]
files = [
{file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"},
{file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"},
@@ -451,6 +473,7 @@ version = "8.5.0"
description = "Read metadata from Python packages"
optional = false
python-versions = ">=3.8"
+groups = ["dev"]
files = [
{file = "importlib_metadata-8.5.0-py3-none-any.whl", hash = "sha256:45e54197d28b7a7f1559e60b95e7c567032b602131fbd588f1497f47880aa68b"},
{file = "importlib_metadata-8.5.0.tar.gz", hash = "sha256:71522656f0abace1d072b9e5481a48f07c138e00f079c38c8f883823f9c26bd7"},
@@ -460,12 +483,12 @@ files = [
zipp = ">=3.20"
[package.extras]
-check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"]
+check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""]
cover = ["pytest-cov"]
doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"]
enabler = ["pytest-enabler (>=2.2)"]
perf = ["ipython"]
-test = ["flufl.flake8", "importlib-resources (>=1.3)", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"]
+test = ["flufl.flake8", "importlib-resources (>=1.3) ; python_version < \"3.9\"", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"]
type = ["pytest-mypy"]
[[package]]
@@ -474,6 +497,7 @@ version = "2.0.0"
description = "brain-dead simple config-ini parsing"
optional = false
python-versions = ">=3.7"
+groups = ["dev"]
files = [
{file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"},
{file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"},
@@ -485,6 +509,7 @@ version = "3.1.5"
description = "A very fast and expressive template engine."
optional = false
python-versions = ">=3.7"
+groups = ["dev"]
files = [
{file = "jinja2-3.1.5-py3-none-any.whl", hash = "sha256:aba0f4dc9ed8013c424088f68a5c226f7d6097ed89b246d7749c2ec4175c6adb"},
{file = "jinja2-3.1.5.tar.gz", hash = "sha256:8fefff8dc3034e27bb80d67c671eb8a9bc424c0ef4c0826edbff304cceff43bb"},
@@ -502,6 +527,7 @@ version = "2.1.5"
description = "Safely add untrusted strings to HTML/XML markup."
optional = false
python-versions = ">=3.7"
+groups = ["dev"]
files = [
{file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc"},
{file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5"},
@@ -571,6 +597,7 @@ version = "1.0.0"
description = "Type system extensions for programs checked with the mypy type checker."
optional = false
python-versions = ">=3.5"
+groups = ["dev"]
files = [
{file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"},
{file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"},
@@ -582,6 +609,7 @@ version = "2.1.0"
description = ""
optional = false
python-versions = ">=3.6,<4.0"
+groups = ["dev"]
files = [
{file = "nr_date-2.1.0-py3-none-any.whl", hash = "sha256:bd672a9dfbdcf7c4b9289fea6750c42490eaee08036a72059dcc78cb236ed568"},
{file = "nr_date-2.1.0.tar.gz", hash = "sha256:0643aea13bcdc2a8bc56af9d5e6a89ef244c9744a1ef00cdc735902ba7f7d2e6"},
@@ -593,6 +621,7 @@ version = "1.1.5"
description = ""
optional = false
python-versions = ">=3.6,<4.0"
+groups = ["dev"]
files = [
{file = "nr_stream-1.1.5-py3-none-any.whl", hash = "sha256:47e12150b331ad2cb729cfd9d2abd281c9949809729ba461c6aa87dd9927b2d4"},
{file = "nr_stream-1.1.5.tar.gz", hash = "sha256:eb0216c6bfc61a46d4568dba3b588502c610ec8ddef4ac98f3932a2bd7264f65"},
@@ -604,6 +633,7 @@ version = "0.8.12"
description = "General purpose Python utility library."
optional = false
python-versions = ">=3.7,<4.0"
+groups = ["dev"]
files = [
{file = "nr.util-0.8.12-py3-none-any.whl", hash = "sha256:91da02ac9795eb8e015372275c1efe54bac9051231ee9b0e7e6f96b0b4e7d2bb"},
{file = "nr.util-0.8.12.tar.gz", hash = "sha256:a4549c2033d99d2f0379b3f3d233fd2a8ade286bbf0b3ad0cc7cea16022214f4"},
@@ -619,6 +649,7 @@ version = "24.1"
description = "Core utilities for Python packages"
optional = false
python-versions = ">=3.8"
+groups = ["main", "dev"]
files = [
{file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"},
{file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"},
@@ -630,6 +661,7 @@ version = "0.12.1"
description = "Utility library for gitignore style pattern matching of file paths."
optional = false
python-versions = ">=3.8"
+groups = ["dev"]
files = [
{file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"},
{file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"},
@@ -641,6 +673,7 @@ version = "4.3.6"
description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`."
optional = false
python-versions = ">=3.8"
+groups = ["dev"]
files = [
{file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"},
{file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"},
@@ -657,6 +690,7 @@ version = "1.5.0"
description = "plugin and hook calling mechanisms for python"
optional = false
python-versions = ">=3.8"
+groups = ["dev"]
files = [
{file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"},
{file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"},
@@ -668,22 +702,23 @@ testing = ["pytest", "pytest-benchmark"]
[[package]]
name = "protobuf"
-version = "5.28.3"
+version = "5.29.4"
description = ""
optional = false
python-versions = ">=3.8"
+groups = ["main"]
files = [
- {file = "protobuf-5.28.3-cp310-abi3-win32.whl", hash = "sha256:0c4eec6f987338617072592b97943fdbe30d019c56126493111cf24344c1cc24"},
- {file = "protobuf-5.28.3-cp310-abi3-win_amd64.whl", hash = "sha256:91fba8f445723fcf400fdbe9ca796b19d3b1242cd873907979b9ed71e4afe868"},
- {file = "protobuf-5.28.3-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:a3f6857551e53ce35e60b403b8a27b0295f7d6eb63d10484f12bc6879c715687"},
- {file = "protobuf-5.28.3-cp38-abi3-manylinux2014_aarch64.whl", hash = "sha256:3fa2de6b8b29d12c61911505d893afe7320ce7ccba4df913e2971461fa36d584"},
- {file = "protobuf-5.28.3-cp38-abi3-manylinux2014_x86_64.whl", hash = "sha256:712319fbdddb46f21abb66cd33cb9e491a5763b2febd8f228251add221981135"},
- {file = "protobuf-5.28.3-cp38-cp38-win32.whl", hash = "sha256:3e6101d095dfd119513cde7259aa703d16c6bbdfae2554dfe5cfdbe94e32d548"},
- {file = "protobuf-5.28.3-cp38-cp38-win_amd64.whl", hash = "sha256:27b246b3723692bf1068d5734ddaf2fccc2cdd6e0c9b47fe099244d80200593b"},
- {file = "protobuf-5.28.3-cp39-cp39-win32.whl", hash = "sha256:135658402f71bbd49500322c0f736145731b16fc79dc8f367ab544a17eab4535"},
- {file = "protobuf-5.28.3-cp39-cp39-win_amd64.whl", hash = "sha256:70585a70fc2dd4818c51287ceef5bdba6387f88a578c86d47bb34669b5552c36"},
- {file = "protobuf-5.28.3-py3-none-any.whl", hash = "sha256:cee1757663fa32a1ee673434fcf3bf24dd54763c79690201208bafec62f19eed"},
- {file = "protobuf-5.28.3.tar.gz", hash = "sha256:64badbc49180a5e401f373f9ce7ab1d18b63f7dd4a9cdc43c92b9f0b481cef7b"},
+ {file = "protobuf-5.29.4-cp310-abi3-win32.whl", hash = "sha256:13eb236f8eb9ec34e63fc8b1d6efd2777d062fa6aaa68268fb67cf77f6839ad7"},
+ {file = "protobuf-5.29.4-cp310-abi3-win_amd64.whl", hash = "sha256:bcefcdf3976233f8a502d265eb65ea740c989bacc6c30a58290ed0e519eb4b8d"},
+ {file = "protobuf-5.29.4-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:307ecba1d852ec237e9ba668e087326a67564ef83e45a0189a772ede9e854dd0"},
+ {file = "protobuf-5.29.4-cp38-abi3-manylinux2014_aarch64.whl", hash = "sha256:aec4962f9ea93c431d5714ed1be1c93f13e1a8618e70035ba2b0564d9e633f2e"},
+ {file = "protobuf-5.29.4-cp38-abi3-manylinux2014_x86_64.whl", hash = "sha256:d7d3f7d1d5a66ed4942d4fefb12ac4b14a29028b209d4bfb25c68ae172059922"},
+ {file = "protobuf-5.29.4-cp38-cp38-win32.whl", hash = "sha256:1832f0515b62d12d8e6ffc078d7e9eb06969aa6dc13c13e1036e39d73bebc2de"},
+ {file = "protobuf-5.29.4-cp38-cp38-win_amd64.whl", hash = "sha256:476cb7b14914c780605a8cf62e38c2a85f8caff2e28a6a0bad827ec7d6c85d68"},
+ {file = "protobuf-5.29.4-cp39-cp39-win32.whl", hash = "sha256:fd32223020cb25a2cc100366f1dedc904e2d71d9322403224cdde5fdced0dabe"},
+ {file = "protobuf-5.29.4-cp39-cp39-win_amd64.whl", hash = "sha256:678974e1e3a9b975b8bc2447fca458db5f93a2fb6b0c8db46b6675b5b5346812"},
+ {file = "protobuf-5.29.4-py3-none-any.whl", hash = "sha256:3fde11b505e1597f71b875ef2fc52062b6a9740e5f7c8997ce878b6009145862"},
+ {file = "protobuf-5.29.4.tar.gz", hash = "sha256:4f1dfcd7997b31ef8f53ec82781ff434a28bf71d9102ddde14d076adcfc78c99"},
]
[[package]]
@@ -692,6 +727,7 @@ version = "4.8.2"
description = "Create Python API documentation in Markdown format."
optional = false
python-versions = ">=3.7,<4.0"
+groups = ["dev"]
files = [
{file = "pydoc_markdown-4.8.2-py3-none-any.whl", hash = "sha256:203f74119e6bb2f9deba43d452422de7c8ec31955b61e0620fa4dd8c2611715f"},
{file = "pydoc_markdown-4.8.2.tar.gz", hash = "sha256:fb6c927e31386de17472d42f9bd3d3be2905977d026f6216881c65145aa67f0b"},
@@ -719,6 +755,7 @@ version = "7.4.4"
description = "pytest: simple powerful testing with Python"
optional = false
python-versions = ">=3.7"
+groups = ["dev"]
files = [
{file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"},
{file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"},
@@ -741,6 +778,7 @@ version = "0.23.8"
description = "Pytest support for asyncio"
optional = false
python-versions = ">=3.8"
+groups = ["dev"]
files = [
{file = "pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2"},
{file = "pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3"},
@@ -759,6 +797,7 @@ version = "0.5.2"
description = "A py.test plugin that parses environment files before running tests"
optional = false
python-versions = "*"
+groups = ["dev"]
files = [
{file = "pytest-dotenv-0.5.2.tar.gz", hash = "sha256:2dc6c3ac6d8764c71c6d2804e902d0ff810fa19692e95fe138aefc9b1aa73732"},
{file = "pytest_dotenv-0.5.2-py3-none-any.whl", hash = "sha256:40a2cece120a213898afaa5407673f6bd924b1fa7eafce6bda0e8abffe2f710f"},
@@ -774,6 +813,7 @@ version = "3.6.1"
description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs"
optional = false
python-versions = ">=3.8"
+groups = ["dev"]
files = [
{file = "pytest_xdist-3.6.1-py3-none-any.whl", hash = "sha256:9ed4adfb68a016610848639bb7e02c9352d5d9f03d04809919e2dafc3be4cca7"},
{file = "pytest_xdist-3.6.1.tar.gz", hash = "sha256:ead156a4db231eec769737f57668ef58a2084a34b2e55c4a8fa20d861107300d"},
@@ -794,6 +834,7 @@ version = "2.9.0.post0"
description = "Extensions to the standard Python datetime module"
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
+groups = ["main"]
files = [
{file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"},
{file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"},
@@ -808,6 +849,7 @@ version = "1.0.1"
description = "Read key-value pairs from a .env file and set them as environment variables"
optional = false
python-versions = ">=3.8"
+groups = ["dev"]
files = [
{file = "python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca"},
{file = "python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a"},
@@ -822,6 +864,7 @@ version = "6.0.2"
description = "YAML parser and emitter for Python"
optional = false
python-versions = ">=3.8"
+groups = ["dev"]
files = [
{file = "PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086"},
{file = "PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf"},
@@ -884,6 +927,7 @@ version = "2.32.3"
description = "Python HTTP for Humans."
optional = false
python-versions = ">=3.8"
+groups = ["dev"]
files = [
{file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"},
{file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"},
@@ -905,19 +949,21 @@ version = "75.3.0"
description = "Easily download, build, install, upgrade, and uninstall Python packages"
optional = false
python-versions = ">=3.8"
+groups = ["dev"]
+markers = "python_version < \"3.10\""
files = [
{file = "setuptools-75.3.0-py3-none-any.whl", hash = "sha256:f2504966861356aa38616760c0f66568e535562374995367b4e69c7143cf6bcd"},
{file = "setuptools-75.3.0.tar.gz", hash = "sha256:fba5dd4d766e97be1b1681d98712680ae8f2f26d7881245f2ce9e40714f1a686"},
]
[package.extras]
-check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)", "ruff (>=0.5.2)"]
-core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.collections", "jaraco.functools", "jaraco.text (>=3.7)", "more-itertools", "more-itertools (>=8.8)", "packaging", "packaging (>=24)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"]
+check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\"", "ruff (>=0.5.2) ; sys_platform != \"cygwin\""]
+core = ["importlib-metadata (>=6) ; python_version < \"3.10\"", "importlib-resources (>=5.10.2) ; python_version < \"3.9\"", "jaraco.collections", "jaraco.functools", "jaraco.text (>=3.7)", "more-itertools", "more-itertools (>=8.8)", "packaging", "packaging (>=24)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1) ; python_version < \"3.11\"", "wheel (>=0.43.0)"]
cover = ["pytest-cov"]
doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"]
enabler = ["pytest-enabler (>=2.2)"]
-test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test (>=5.5)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"]
-type = ["importlib-metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (==1.12.*)", "pytest-mypy"]
+test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21) ; python_version >= \"3.9\" and sys_platform != \"cygwin\"", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test (>=5.5)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf ; sys_platform != \"cygwin\"", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"]
+type = ["importlib-metadata (>=7.0.2) ; python_version < \"3.10\"", "jaraco.develop (>=7.21) ; sys_platform != \"cygwin\"", "mypy (==1.12.*)", "pytest-mypy"]
[[package]]
name = "six"
@@ -925,6 +971,7 @@ version = "1.16.0"
description = "Python 2 and 3 compatibility utilities"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
+groups = ["main"]
files = [
{file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"},
{file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"},
@@ -936,6 +983,7 @@ version = "1.3.1"
description = "Sniff out which async library your code is running under"
optional = false
python-versions = ">=3.7"
+groups = ["main"]
files = [
{file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"},
{file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"},
@@ -947,6 +995,7 @@ version = "2.0.2"
description = "A lil' TOML parser"
optional = false
python-versions = ">=3.8"
+groups = ["dev"]
files = [
{file = "tomli-2.0.2-py3-none-any.whl", hash = "sha256:2ebe24485c53d303f690b0ec092806a085f07af5a5aa1464f3931eec36caaa38"},
{file = "tomli-2.0.2.tar.gz", hash = "sha256:d46d457a85337051c36524bc5349dd91b1877838e2979ac5ced3e710ed8a60ed"},
@@ -958,6 +1007,7 @@ version = "1.0.0"
description = "A lil' TOML writer"
optional = false
python-versions = ">=3.7"
+groups = ["dev"]
files = [
{file = "tomli_w-1.0.0-py3-none-any.whl", hash = "sha256:9f2a07e8be30a0729e533ec968016807069991ae2fd921a78d42f429ae5f4463"},
{file = "tomli_w-1.0.0.tar.gz", hash = "sha256:f463434305e0336248cac9c2dc8076b707d8a12d019dd349f5c1e382dd1ae1b9"},
@@ -969,6 +1019,7 @@ version = "2.2.3"
description = ""
optional = false
python-versions = "<4.0,>=3.8"
+groups = ["dev"]
files = [
{file = "typeapi-2.2.3-py3-none-any.whl", hash = "sha256:038062b473dd9bc182966469d7a37d81ba7fa5bb0c01f30b0604b5667b13a47b"},
{file = "typeapi-2.2.3.tar.gz", hash = "sha256:61cf8c852c05471522fcf55ec37d0c37f0de6943cc8e4d58529f796881e32c08"},
@@ -983,6 +1034,7 @@ version = "4.12.2"
description = "Backported and Experimental Type Hints for Python 3.8+"
optional = false
python-versions = ">=3.8"
+groups = ["main", "dev"]
files = [
{file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"},
{file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"},
@@ -994,13 +1046,14 @@ version = "2.2.3"
description = "HTTP library with thread-safe connection pooling, file post, and more."
optional = false
python-versions = ">=3.8"
+groups = ["dev"]
files = [
{file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"},
{file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"},
]
[package.extras]
-brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"]
+brotli = ["brotli (>=1.0.9) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\""]
h2 = ["h2 (>=4,<5)"]
socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"]
zstd = ["zstandard (>=0.18.0)"]
@@ -1011,6 +1064,7 @@ version = "4.0.2"
description = "Filesystem events monitoring"
optional = false
python-versions = ">=3.8"
+groups = ["dev"]
files = [
{file = "watchdog-4.0.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:ede7f010f2239b97cc79e6cb3c249e72962404ae3865860855d5cbe708b0fd22"},
{file = "watchdog-4.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a2cffa171445b0efa0726c561eca9a27d00a1f2b83846dbd5a4f639c4f8ca8e1"},
@@ -1058,6 +1112,7 @@ version = "1.16.0"
description = "Module for decorators, wrappers and monkey patching."
optional = false
python-versions = ">=3.6"
+groups = ["dev"]
files = [
{file = "wrapt-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ffa565331890b90056c01db69c0fe634a776f8019c143a5ae265f9c6bc4bd6d4"},
{file = "wrapt-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e4fdb9275308292e880dcbeb12546df7f3e0f96c6b41197e0cf37d2826359020"},
@@ -1137,6 +1192,7 @@ version = "0.40.2"
description = "A formatter for Python code"
optional = false
python-versions = ">=3.7"
+groups = ["dev"]
files = [
{file = "yapf-0.40.2-py3-none-any.whl", hash = "sha256:adc8b5dd02c0143108878c499284205adb258aad6db6634e5b869e7ee2bd548b"},
{file = "yapf-0.40.2.tar.gz", hash = "sha256:4dab8a5ed7134e26d57c1647c7483afb3f136878b579062b786c9ba16b94637b"},
@@ -1153,20 +1209,21 @@ version = "3.20.2"
description = "Backport of pathlib-compatible object wrapper for zip files"
optional = false
python-versions = ">=3.8"
+groups = ["dev"]
files = [
{file = "zipp-3.20.2-py3-none-any.whl", hash = "sha256:a817ac80d6cf4b23bf7f2828b7cabf326f15a001bea8b1f9b49631780ba28350"},
{file = "zipp-3.20.2.tar.gz", hash = "sha256:bc9eb26f4506fda01b81bcde0ca78103b6e62f991b381fec825435c836edbc29"},
]
[package.extras]
-check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"]
+check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""]
cover = ["pytest-cov"]
doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"]
enabler = ["pytest-enabler (>=2.2)"]
-test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-ignore-flaky"]
+test = ["big-O", "importlib-resources ; python_version < \"3.9\"", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-ignore-flaky"]
type = ["pytest-mypy"]
[metadata]
-lock-version = "2.0"
+lock-version = "2.1"
python-versions = "^3.9"
-content-hash = "ce024521a2289f3e314cbd1cea46e42522878e82633777ef484deb987bb271cb"
+content-hash = "0fa4670368dc0adfabc7626bea65205cd769253905bb70d99a1c3da34d0594d8"
diff --git a/packages/python-sdk/pyproject.toml b/packages/python-sdk/pyproject.toml
index 090294c3d..6f0c281f0 100644
--- a/packages/python-sdk/pyproject.toml
+++ b/packages/python-sdk/pyproject.toml
@@ -13,7 +13,7 @@ packages = [{ include = "e2b" }, { include = "e2b_connect" }]
python = "^3.9"
python-dateutil = ">=2.8.2"
-protobuf = ">=3.20.0, <6.0.0"
+protobuf = ">=5.29.4, <6.0.0"
httpcore = "^1.0.5"
httpx = ">=0.27.0, <1.0.0"
attrs = ">=23.2.0"
diff --git a/packages/python-sdk/scripts/fix-python-pb.sh b/packages/python-sdk/scripts/fix-python-pb.sh
index a29b5855d..7bdea385a 100755
--- a/packages/python-sdk/scripts/fix-python-pb.sh
+++ b/packages/python-sdk/scripts/fix-python-pb.sh
@@ -4,8 +4,8 @@ rm -rf e2b/envd/__pycache__
rm -rf e2b/envd/filesystem/__pycache__
rm -rf e2b/envd/process/__pycache__
-sed -i '.bak' 's/from\ process\ import/from e2b.envd.process import/g' e2b/envd/process/* e2b/envd/filesystem/*
-sed -i '.bak' 's/from\ filesystem\ import/from e2b.envd.filesystem import/g' e2b/envd/process/* e2b/envd/filesystem/*
+sed -i.bak 's/from\ process\ import/from e2b.envd.process import/g' e2b/envd/process/* e2b/envd/filesystem/*
+sed -i.bak 's/from\ filesystem\ import/from e2b.envd.filesystem import/g' e2b/envd/process/* e2b/envd/filesystem/*
-rm e2b/envd/process/*.bak
-rm e2b/envd/filesystem/*.bak
+rm -f e2b/envd/process/*.bak
+rm -f e2b/envd/filesystem/*.bak
diff --git a/packages/python-sdk/tests/async/sandbox_async/commands/test_run.py b/packages/python-sdk/tests/async/sandbox_async/commands/test_run.py
index d8f855482..f871ebdc6 100644
--- a/packages/python-sdk/tests/async/sandbox_async/commands/test_run.py
+++ b/packages/python-sdk/tests/async/sandbox_async/commands/test_run.py
@@ -18,16 +18,20 @@ async def test_run_with_special_characters(async_sandbox: AsyncSandbox):
cmd = await async_sandbox.commands.run(f'echo "{text}"')
assert cmd.exit_code == 0
- # assert cmd.stdout == f"{text}\n"
+
+
+# assert cmd.stdout == f"{text}\n"
+
async def test_run_with_broken_utf8(async_sandbox: AsyncSandbox):
# Create a string with 8191 'a' characters followed by the problematic byte 0xe2
- long_str = 'a' * 8191 + '\\xe2'
+ long_str = "a" * 8191 + "\\xe2"
result = await async_sandbox.commands.run(f'printf "{long_str}"')
assert result.exit_code == 0
# The broken UTF-8 bytes should be replaced with the Unicode replacement character
- assert result.stdout == ('a' * 8191 + '\ufffd')
+ assert result.stdout == ("a" * 8191 + "\ufffd")
+
async def test_run_with_multiline_string(async_sandbox: AsyncSandbox):
text = "Hello,\nWorld!"
diff --git a/packages/python-sdk/tests/async/sandbox_async/files/test_write.py b/packages/python-sdk/tests/async/sandbox_async/files/test_write.py
index 0e91c11c9..b413112aa 100644
--- a/packages/python-sdk/tests/async/sandbox_async/files/test_write.py
+++ b/packages/python-sdk/tests/async/sandbox_async/files/test_write.py
@@ -3,6 +3,7 @@ import io
from e2b import AsyncSandbox
from e2b.sandbox_async.filesystem.filesystem import EntryInfo
+
async def test_write_text_file(async_sandbox: AsyncSandbox):
filename = "test_write.txt"
content = "This is a test file."
@@ -22,11 +23,12 @@ async def test_write_text_file(async_sandbox: AsyncSandbox):
read_content = await async_sandbox.files.read(filename)
assert read_content == content
+
async def test_write_binary_file(async_sandbox: AsyncSandbox):
filename = "test_write.txt"
text = "This is a test binary file."
# equivalent to `open("path/to/local/file", "rb")`
- content = io.BytesIO(text.encode('utf-8'))
+ content = io.BytesIO(text.encode("utf-8"))
info = await async_sandbox.files.write(filename, content)
assert info.path == f"/home/user/{filename}"
@@ -37,6 +39,7 @@ async def test_write_binary_file(async_sandbox: AsyncSandbox):
read_content = await async_sandbox.files.read(filename)
assert read_content == text
+
async def test_write_multiple_files(async_sandbox: AsyncSandbox):
# Attempt to write with empty files array
empty_info = await async_sandbox.files.write([])
@@ -51,12 +54,20 @@ async def test_write_multiple_files(async_sandbox: AsyncSandbox):
# Attempt to write with path and file array
try:
- await async_sandbox.files.write("/path/to/file", [{ "path": "one_test_file.txt", "data": "This is a test file." }])
+ await async_sandbox.files.write(
+ "/path/to/file",
+ [{"path": "one_test_file.txt", "data": "This is a test file."}],
+ )
except Exception as e:
- assert "Cannot specify both path and array of files. You have to specify either path and data for a single file or an array for multiple files." in str(e)
+ assert (
+ "Cannot specify both path and array of files. You have to specify either path and data for a single file or an array for multiple files."
+ in str(e)
+ )
# Attempt to write with one file in array
- info = await async_sandbox.files.write([{ "path": "one_test_file.txt", "data": "This is a test file." }])
+ info = await async_sandbox.files.write(
+ [{"path": "one_test_file.txt", "data": "This is a test file."}]
+ )
assert isinstance(info, list)
assert len(info) == 1
info = info[0]
@@ -87,6 +98,7 @@ async def test_write_multiple_files(async_sandbox: AsyncSandbox):
read_content = await async_sandbox.files.read(info.path)
assert read_content == files[i]["data"]
+
async def test_overwrite_file(async_sandbox: AsyncSandbox):
filename = "test_overwrite.txt"
initial_content = "Initial content."
diff --git a/packages/python-sdk/tests/async/sandbox_async/test_timeout.py b/packages/python-sdk/tests/async/sandbox_async/test_timeout.py
index 4ed1e05a7..7474b084f 100644
--- a/packages/python-sdk/tests/async/sandbox_async/test_timeout.py
+++ b/packages/python-sdk/tests/async/sandbox_async/test_timeout.py
@@ -23,7 +23,8 @@ async def test_shorten_then_lengthen_timeout(async_sandbox: AsyncSandbox):
sleep(6)
await async_sandbox.is_running()
+
@pytest.mark.skip_debug()
async def test_get_timeout(async_sandbox: AsyncSandbox):
info = await async_sandbox.get_info()
- assert isinstance(info.end_at, datetime)
\ No newline at end of file
+ assert isinstance(info.end_at, datetime)
diff --git a/packages/python-sdk/tests/sync/sandbox_sync/files/test_write.py b/packages/python-sdk/tests/sync/sandbox_sync/files/test_write.py
index 263b2fd0c..2cbf404fc 100644
--- a/packages/python-sdk/tests/sync/sandbox_sync/files/test_write.py
+++ b/packages/python-sdk/tests/sync/sandbox_sync/files/test_write.py
@@ -2,6 +2,7 @@ import io
from e2b.sandbox.filesystem.filesystem import EntryInfo
+
def test_write_text_file(sandbox):
filename = "test_write.txt"
content = "This is a test file."
@@ -21,11 +22,12 @@ def test_write_text_file(sandbox):
read_content = sandbox.files.read(filename)
assert read_content == content
+
def test_write_binary_file(sandbox):
filename = "test_write.txt"
text = "This is a test binary file."
# equivalent to `open("path/to/local/file", "rb")`
- content = io.BytesIO(text.encode('utf-8'))
+ content = io.BytesIO(text.encode("utf-8"))
info = sandbox.files.write(filename, content)
assert info.path == f"/home/user/{filename}"
@@ -36,6 +38,7 @@ def test_write_binary_file(sandbox):
read_content = sandbox.files.read(filename)
assert read_content == text
+
def test_write_multiple_files(sandbox):
# Attempt to write with empty files array
empty_info = sandbox.files.write([])
@@ -50,12 +53,20 @@ def test_write_multiple_files(sandbox):
# Attempt to write with path and file array
try:
- sandbox.files.write("/path/to/file", [{ "path": "one_test_file.txt", "data": "This is a test file." }])
+ sandbox.files.write(
+ "/path/to/file",
+ [{"path": "one_test_file.txt", "data": "This is a test file."}],
+ )
except Exception as e:
- assert "Cannot specify both path and array of files. You have to specify either path and data for a single file or an array for multiple files." in str(e)
+ assert (
+ "Cannot specify both path and array of files. You have to specify either path and data for a single file or an array for multiple files."
+ in str(e)
+ )
# Attempt to write with one file in array
- info = sandbox.files.write([{ "path": "one_test_file.txt", "data": "This is a test file." }])
+ info = sandbox.files.write(
+ [{"path": "one_test_file.txt", "data": "This is a test file."}]
+ )
assert isinstance(info, list)
assert len(info) == 1
info = info[0]
@@ -86,6 +97,7 @@ def test_write_multiple_files(sandbox):
read_content = sandbox.files.read(info.path)
assert read_content == files[i]["data"]
+
def test_overwrite_file(sandbox):
filename = "test_overwrite.txt"
initial_content = "Initial content."
diff --git a/packages/python-sdk/tests/sync/sandbox_sync/test_timeout.py b/packages/python-sdk/tests/sync/sandbox_sync/test_timeout.py
index 1d7a5d9d1..f175e7b9e 100644
--- a/packages/python-sdk/tests/sync/sandbox_sync/test_timeout.py
+++ b/packages/python-sdk/tests/sync/sandbox_sync/test_timeout.py
@@ -21,7 +21,8 @@ def test_shorten_then_lengthen_timeout(sandbox):
sleep(6)
sandbox.is_running()
+
@pytest.mark.skip_debug()
def test_get_timeout(sandbox):
info = sandbox.get_info()
- assert isinstance(info.end_at, datetime)
\ No newline at end of file
+ assert isinstance(info.end_at, datetime)
diff --git a/scripts/codegen.sh b/scripts/codegen.sh
new file mode 100755
index 000000000..738d19aaf
--- /dev/null
+++ b/scripts/codegen.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -eu
+
+# This script is used for codegen from openapi and envd spec in a docker container
+# run this script from the root of the repo
+
+docker run -v "$(pwd):/workspace" $(docker build -q -t codegen-env . -f codegen.Dockerfile)
diff --git a/spec/envd/buf-python.gen.yaml b/spec/envd/buf-python.gen.yaml
index 6ee4cb61f..286053db9 100644
--- a/spec/envd/buf-python.gen.yaml
+++ b/spec/envd/buf-python.gen.yaml
@@ -8,7 +8,7 @@ plugins:
- pyi_out=../../packages/python-sdk/e2b/envd
- name: connect-python
out: ../../packages/python-sdk/e2b/envd
- path: ../../packages/connect-python/bin/protoc-gen-connect-python
+ path: /go/bin/protoc-gen-connect-python
managed:
enabled: true