1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 poetry-core,
8
9 # dependencies
10 attrs,
11 e2b,
12 httpx,
13}:
14
15buildPythonPackage rec {
16 pname = "e2b-code-interpreter";
17 inherit (e2b) version;
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "e2b-dev";
22 repo = "code-interpreter";
23 tag = "@e2b/code-interpreter-python@${version}";
24 hash = "sha256-a2rc7BtV+qwtqlB+JtLCs0BKN15yfwmG3XWWO8we2LA=";
25 };
26
27 sourceRoot = "${src.name}/python";
28
29 build-system = [
30 poetry-core
31 ];
32
33 dependencies = [
34 attrs
35 e2b
36 httpx
37 ];
38
39 pythonImportsCheck = [ "e2b_code_interpreter" ];
40
41 # Tests require an API key
42 # e2b.exceptions.AuthenticationException: API key is required, please visit the Team tab at https://e2b.dev/dashboard to get your API key.
43 doCheck = false;
44
45 meta = {
46 description = "E2B Code Interpreter - Stateful code execution";
47 homepage = "https://github.com/e2b-dev/code-interpreter/tree/main/python";
48 license = lib.licenses.asl20;
49 maintainers = with lib.maintainers; [ GaetanLepage ];
50 };
51}