Something went wrong. Try again.
Nix Packages collection & NixOS github.com/NixOS/nixpkgs
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102{ lib, buildPythonPackage, fetchFromGitHub,
# build-system uv-build,
# dependencies attrs, connectrpc, dockerfile-parse, h2, httpx, packaging, protobuf-py, pyqwest, python-dateutil, rich, typing-extensions, wcmatch,
# tests pytest-asyncio, pytest-timeout, pytestCheckHook,}:
buildPythonPackage (finalAttrs: { pname = "e2b"; version = "2.51.0"; pyproject = true; __structuredAttrs = true;
src = fetchFromGitHub { owner = "e2b-dev"; repo = "E2B"; tag = "@e2b/python-sdk@${finalAttrs.version}"; hash = "sha256-Q/DhYn2dyzXytgccC6QNBlvkhM+hxqgmMeKAsVlQJuk="; };
sourceRoot = "${finalAttrs.src.name}/packages/python-sdk";
# Upstream caps the build backend at uv_build<0.11.0; ours is newer. postPatch = '' substituteInPlace pyproject.toml \ --replace-fail "uv_build>=0.10.0,<0.11.0" "uv_build" '';
pythonRelaxDeps = [ "h2" ];
build-system = [ uv-build ];
dependencies = [ attrs connectrpc dockerfile-parse h2 httpx packaging protobuf-py pyqwest python-dateutil rich typing-extensions wcmatch ];
pythonImportsCheck = [ "e2b" ];
nativeCheckInputs = [ pytest-asyncio pytest-timeout pytestCheckHook ];
# Everything under tests/{async,sync,bugs} drives a real sandbox and needs an # API key. The rest runs offline against an in-process envd frame server. enabledTestPaths = [ "tests/test_*.py" ];
# Import e2b from $out rather than the source tree. preCheck = '' rm -r e2b '';
# The offline tests exercise the transport against an in-process server. __darwinAllowLocalNetworking = true;
meta = { description = "Cloud environments for AI agents"; homepage = "https://github.com/e2b-dev/E2B/blob/main/packages/python-sdk"; changelog = "https://github.com/e2b-dev/E2B/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ GaetanLepage mishushakov ]; };})