summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/e2b-code-interpreter/default.nix
blob: 2e0f21bcf779536cb2764d8d4595b9a0cb491e94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  poetry-core,

  # dependencies
  attrs,
  e2b,
  httpx,
}:

buildPythonPackage rec {
  pname = "e2b-code-interpreter";
  inherit (e2b) version;
  pyproject = true;

  src = fetchFromGitHub {
    owner = "e2b-dev";
    repo = "code-interpreter";
    tag = "@e2b/code-interpreter-python@${version}";
    hash = "sha256-a2rc7BtV+qwtqlB+JtLCs0BKN15yfwmG3XWWO8we2LA=";
  };

  sourceRoot = "${src.name}/python";

  build-system = [
    poetry-core
  ];

  dependencies = [
    attrs
    e2b
    httpx
  ];

  pythonImportsCheck = [ "e2b_code_interpreter" ];

  # Tests require an API key
  # e2b.exceptions.AuthenticationException: API key is required, please visit the Team tab at https://e2b.dev/dashboard to get your API key.
  doCheck = false;

  meta = {
    description = "E2B Code Interpreter - Stateful code execution";
    homepage = "https://github.com/e2b-dev/code-interpreter/tree/main/python";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ GaetanLepage ];
  };
}