ks: add completions for bash and zsh (#364049)
[NixPkgs.git] / pkgs / by-name / ai / aider-chat / package.nix
blob6374b9b38e4c6d99ff0b52db1acf5e5348d64f15
2   lib,
3   stdenv,
4   python311,
5   fetchFromGitHub,
6   gitMinimal,
7   portaudio,
8 }:
10 let
11   python3 = python311.override {
12     self = python3;
13     packageOverrides = _: super: { tree-sitter = super.tree-sitter_0_21; };
14   };
15   version = "0.66.0";
16   aider-chat = python3.pkgs.buildPythonApplication {
17     pname = "aider-chat";
18     inherit version;
19     pyproject = true;
21     src = fetchFromGitHub {
22       owner = "Aider-AI";
23       repo = "aider";
24       rev = "refs/tags/v${version}";
25       hash = "sha256-6wD8wBDV6Roo3J+oEYiBzZ7i1iGOZhcoiKXHV7AJjDk=";
26     };
28     pythonRelaxDeps = true;
30     build-system = with python3.pkgs; [ setuptools-scm ];
32     dependencies = with python3.pkgs; [
33       aiohappyeyeballs
34       aiohttp
35       aiosignal
36       annotated-types
37       anyio
38       attrs
39       backoff
40       beautifulsoup4
41       certifi
42       cffi
43       charset-normalizer
44       click
45       configargparse
46       diff-match-patch
47       diskcache
48       distro
49       filelock
50       flake8
51       frozenlist
52       fsspec
53       gitdb
54       gitpython
55       grep-ast
56       h11
57       httpcore
58       httpx
59       huggingface-hub
60       idna
61       importlib-resources
62       jinja2
63       jiter
64       json5
65       jsonschema
66       jsonschema-specifications
67       litellm
68       markdown-it-py
69       markupsafe
70       mccabe
71       mdurl
72       multidict
73       networkx
74       numpy
75       openai
76       packaging
77       pathspec
78       pexpect
79       pillow
80       prompt-toolkit
81       psutil
82       ptyprocess
83       pycodestyle
84       pycparser
85       pydantic
86       pydantic-core
87       pydub
88       pyflakes
89       pygments
90       pypandoc
91       pyperclip
92       python-dotenv
93       pyyaml
94       referencing
95       regex
96       requests
97       rich
98       rpds-py
99       scipy
100       smmap
101       sniffio
102       sounddevice
103       soundfile
104       soupsieve
105       tiktoken
106       tokenizers
107       tqdm
108       tree-sitter
109       tree-sitter-languages
110       typing-extensions
111       urllib3
112       wcwidth
113       yarl
114       zipp
116       # Not listed in requirements
117       mixpanel
118       monotonic
119       posthog
120       propcache
121       python-dateutil
122     ];
124     buildInputs = [ portaudio ];
126     nativeCheckInputs = (with python3.pkgs; [ pytestCheckHook ]) ++ [ gitMinimal ];
128     disabledTestPaths = [
129       # Tests require network access
130       "tests/scrape/test_scrape.py"
131       # Expected 'mock' to have been called once
132       "tests/help/test_help.py"
133     ];
135     disabledTests =
136       [
137         # Tests require network
138         "test_urls"
139         "test_get_commit_message_with_custom_prompt"
140         # FileNotFoundError
141         "test_get_commit_message"
142         # Expected 'launch_gui' to have been called once
143         "test_browser_flag_imports_streamlit"
144         # AttributeError
145         "test_simple_send_with_retries"
146         # Expected 'check_version' to have been called once
147         "test_main_exit_calls_version_check"
148       ]
149       ++ lib.optionals stdenv.hostPlatform.isDarwin [
150         # Tests fails on darwin
151         "test_dark_mode_sets_code_theme"
152         "test_default_env_file_sets_automatic_variable"
153         # FileNotFoundError: [Errno 2] No such file or directory: 'vim'
154         "test_pipe_editor"
155       ];
157     makeWrapperArgs = [
158       "--set AIDER_CHECK_UPDATE false"
159       "--set AIDER_ANALYTICS false"
160     ];
162     preCheck = ''
163       export HOME=$(mktemp -d)
164       export AIDER_ANALYTICS="false"
165     '';
167     optional-dependencies = with python3.pkgs; {
168       playwright = [
169         greenlet
170         playwright
171         pyee
172         typing-extensions
173       ];
174     };
176     passthru = {
177       withPlaywright = aider-chat.overridePythonAttrs (
178         { dependencies, ... }:
179         {
180           dependencies = dependencies ++ aider-chat.optional-dependencies.playwright;
181         }
182       );
183     };
185     meta = {
186       description = "AI pair programming in your terminal";
187       homepage = "https://github.com/paul-gauthier/aider";
188       changelog = "https://github.com/paul-gauthier/aider/blob/v${version}/HISTORY.md";
189       license = lib.licenses.asl20;
190       maintainers = with lib.maintainers; [ taha-yassine ];
191       mainProgram = "aider";
192     };
193   };
195 aider-chat