1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5 pythonOlder,
6 pythonRelaxDepsHook,
7 poetry-core,
8
9 appdirs,
10 astor,
11 inquirer,
12 litellm,
13 pyyaml,
14 rich,
15 six,
16 tiktoken,
17 tokentrim,
18 wget,
19 psutil,
20 html2image,
21 ipykernel,
22 jupyter-client,
23 matplotlib,
24 toml,
25 posthog,
26 openai,
27 setuptools,
28}:
29
30buildPythonPackage rec {
31 pname = "open-interpreter";
32 version = "0.2.0";
33 pyproject = true;
34
35 disabled = pythonOlder "3.9";
36
37 src = fetchFromGitHub {
38 owner = "KillianLucas";
39 repo = pname;
40 rev = "v${version}";
41 hash = "sha256-XeJ6cADtyXtqoTXwYJu+i9d3NYbJCLpYOeZYmdImtwI=";
42 };
43
44 # Remove unused dependency
45 postPatch = ''
46 substituteInPlace pyproject.toml --replace 'git-python = "^1.0.3"' ""
47 '';
48
49 pythonRelaxDeps = [ "tiktoken" ];
50
51 nativeBuildInputs = [
52 poetry-core
53 pythonRelaxDepsHook
54 ];
55
56 propagatedBuildInputs = [
57 appdirs
58 astor
59 inquirer
60 litellm
61 pyyaml
62 rich
63 six
64 tiktoken
65 tokentrim
66 wget
67 psutil
68 html2image
69 ipykernel
70 jupyter-client
71 matplotlib
72 toml
73 posthog
74 openai
75
76 # Not explicitly in pyproject.toml but required due to use of `pkgs_resources`
77 setuptools
78 ];
79
80 pythonImportsCheck = [ "interpreter" ];
81
82 # Most tests required network access
83 doCheck = false;
84
85 meta = with lib; {
86 description = "OpenAI's Code Interpreter in your terminal, running locally";
87 homepage = "https://github.com/KillianLucas/open-interpreter";
88 license = licenses.mit;
89 changelog = "https://github.com/KillianLucas/open-interpreter/releases/tag/v${version}";
90 maintainers = with maintainers; [ happysalada ];
91 mainProgram = "interpreter";
92 };
93}