From 1fc68917415080b32068d545748b202ef5076fc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 15 Jul 2025 19:18:16 -0700 Subject: [PATCH] aider-chat: move to top-level It does not provide a public Python API. --- .../ai}/aider-chat/fix-flake8-invoke.patch | 0 .../ai/aider-chat/package.nix} | 132 ++---------------- pkgs/top-level/all-packages.nix | 22 +-- pkgs/top-level/python-packages.nix | 2 - 4 files changed, 16 insertions(+), 140 deletions(-) rename pkgs/{development/python-modules => by-name/ai}/aider-chat/fix-flake8-invoke.patch (100%) rename pkgs/{development/python-modules/aider-chat/default.nix => by-name/ai/aider-chat/package.nix} (76%) diff --git a/pkgs/development/python-modules/aider-chat/fix-flake8-invoke.patch b/pkgs/by-name/ai/aider-chat/fix-flake8-invoke.patch similarity index 100% rename from pkgs/development/python-modules/aider-chat/fix-flake8-invoke.patch rename to pkgs/by-name/ai/aider-chat/fix-flake8-invoke.patch diff --git a/pkgs/development/python-modules/aider-chat/default.nix b/pkgs/by-name/ai/aider-chat/package.nix similarity index 76% rename from pkgs/development/python-modules/aider-chat/default.nix rename to pkgs/by-name/ai/aider-chat/package.nix index 11cbaaa39908..60ca5809d185 100644 --- a/pkgs/development/python-modules/aider-chat/default.nix +++ b/pkgs/by-name/ai/aider-chat/package.nix @@ -1,140 +1,30 @@ { lib, stdenv, - buildPythonPackage, + python312Packages, fetchFromGitHub, replaceVars, gitMinimal, portaudio, playwright-driver, - pythonOlder, - pythonAtLeast, - setuptools-scm, - aiohappyeyeballs, - aiohttp, - aiosignal, - annotated-types, - anyio, - attrs, - backoff, - beautifulsoup4, - cachetools, - certifi, - cffi, - charset-normalizer, - click, - configargparse, - diff-match-patch, - diskcache, - distro, - filelock, - flake8, - frozenlist, - fsspec, - gitdb, - gitpython, - google-ai-generativelanguage, - google-generativeai, - grep-ast, - h11, - hf-xet, - httpcore, - httpx, - huggingface-hub, - idna, - importlib-resources, - jinja2, - jiter, - json5, - jsonschema, - jsonschema-specifications, - litellm, - markdown-it-py, - markupsafe, - mccabe, - mdurl, - multidict, - networkx, - numpy, - openai, - oslex, - packaging, - pathspec, - pexpect, - pillow, - prompt-toolkit, - psutil, - ptyprocess, - pycodestyle, - pycparser, - pydantic, - pydantic-core, - pydub, - pyflakes, - pygments, - pypandoc, - pyperclip, - python-dotenv, - pyyaml, - referencing, - regex, - requests, - rich, - rpds-py, - scipy, - shtab, - smmap, - sniffio, - sounddevice, - socksio, - soundfile, - soupsieve, - tiktoken, - tokenizers, - tqdm, - tree-sitter, - tree-sitter-language-pack, - typing-extensions, - typing-inspection, - urllib3, - watchfiles, - wcwidth, - yarl, - zipp, - pip, - mixpanel, - monotonic, - posthog, - propcache, - python-dateutil, - pytestCheckHook, - greenlet, - playwright, - pyee, - streamlit, - llama-index-core, - llama-index-embeddings-huggingface, - torch, - nltk, - boto3, nix-update-script, }: let - aider-nltk-data = nltk.dataDir (d: [ + # dont support python 3.13 (Aider-AI/aider#3037) + python3Packages = python312Packages; + + aider-nltk-data = python3Packages.nltk.dataDir (d: [ d.punkt-tab d.stopwords ]); version = "0.85.1"; - aider-chat = buildPythonPackage { + aider-chat = python3Packages.buildPythonApplication { pname = "aider-chat"; inherit version; pyproject = true; - # dont support python 3.13 (Aider-AI/aider#3037) - disabled = pythonOlder "3.10" || pythonAtLeast "3.13"; - src = fetchFromGitHub { owner = "Aider-AI"; repo = "aider"; @@ -144,9 +34,9 @@ let pythonRelaxDeps = true; - build-system = [ setuptools-scm ]; + build-system = with python3Packages; [ setuptools-scm ]; - dependencies = [ + dependencies = with python3Packages; [ aiohappyeyeballs aiohttp aiosignal @@ -251,13 +141,13 @@ let buildInputs = [ portaudio ]; nativeCheckInputs = [ - pytestCheckHook + python3Packages.pytestCheckHook gitMinimal ]; patches = [ (replaceVars ./fix-flake8-invoke.patch { - flake8 = lib.getExe flake8; + flake8 = lib.getExe python3Packages.flake8; }) ]; @@ -308,7 +198,7 @@ let export AIDER_ANALYTICS="false" ''; - optional-dependencies = { + optional-dependencies = with python3Packages; { playwright = [ greenlet playwright diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b9b1e511533c..c4200ba6028b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -201,27 +201,15 @@ with pkgs; } ../build-support/setup-hooks/add-bin-to-path.sh ) { }; - aider-chat = with python312Packages; toPythonApplication aider-chat; + aider-chat-with-playwright = aider-chat.withOptional { withPlaywright = true; }; - aider-chat-with-playwright = - with python312Packages; - toPythonApplication (aider-chat.withOptional { withPlaywright = true; }); + aider-chat-with-browser = aider-chat.withOptional { withBrowser = true; }; - aider-chat-with-browser = - with python312Packages; - toPythonApplication (aider-chat.withOptional { withBrowser = true; }); + aider-chat-with-help = aider-chat.withOptional { withHelp = true; }; - aider-chat-with-help = - with python312Packages; - toPythonApplication (aider-chat.withOptional { withHelp = true; }); + aider-chat-with-bedrock = aider-chat.withOptional { withBedrock = true; }; - aider-chat-with-bedrock = - with python312Packages; - toPythonApplication (aider-chat.withOptional { withBedrock = true; }); - - aider-chat-full = - with python312Packages; - toPythonApplication (aider-chat.withOptional { withAll = true; }); + aider-chat-full = aider-chat.withOptional { withAll = true; }; autoreconfHook = callPackage ( { diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 86cadaed9737..e0aee70d2471 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -144,8 +144,6 @@ self: super: with self; { ahocorasick-rs = callPackage ../development/python-modules/ahocorasick-rs { }; - aider-chat = callPackage ../development/python-modules/aider-chat { }; - aigpy = callPackage ../development/python-modules/aigpy { }; ailment = callPackage ../development/python-modules/ailment { };