From c25bc14f677585545fac7bdc61bc5c2e31a85047 Mon Sep 17 00:00:00 2001 From: Zexin Yuan Date: Thu, 17 Jul 2025 12:16:39 +0800 Subject: [PATCH 1/3] aider-chat: fix tree-sitter query --- .../ai/aider-chat/fix-tree-sitter.patch | 21 +++++++++++++++++++ pkgs/by-name/ai/aider-chat/package.nix | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 pkgs/by-name/ai/aider-chat/fix-tree-sitter.patch diff --git a/pkgs/by-name/ai/aider-chat/fix-tree-sitter.patch b/pkgs/by-name/ai/aider-chat/fix-tree-sitter.patch new file mode 100644 index 000000000000..df06e6036294 --- /dev/null +++ b/pkgs/by-name/ai/aider-chat/fix-tree-sitter.patch @@ -0,0 +1,21 @@ +diff --git a/aider/repomap.py b/aider/repomap.py +index 23eee239..0a40f2e6 100644 +--- a/aider/repomap.py ++++ b/aider/repomap.py +@@ -16,6 +16,7 @@ from grep_ast import TreeContext, filename_to_lang + from pygments.lexers import guess_lexer_for_filename + from pygments.token import Token + from tqdm import tqdm ++from tree_sitter import QueryCursor + + from aider.dump import dump + from aider.special import filter_important_files +@@ -286,7 +287,7 @@ class RepoMap: + + # Run the tags queries + query = language.query(query_scm) +- captures = query.captures(tree.root_node) ++ captures = QueryCursor(query).captures(tree.root_node) + + saw = set() + if USING_TSL_PACK: diff --git a/pkgs/by-name/ai/aider-chat/package.nix b/pkgs/by-name/ai/aider-chat/package.nix index 60ca5809d185..cd1a52b98acf 100644 --- a/pkgs/by-name/ai/aider-chat/package.nix +++ b/pkgs/by-name/ai/aider-chat/package.nix @@ -146,6 +146,8 @@ let ]; patches = [ + ./fix-tree-sitter.patch + (replaceVars ./fix-flake8-invoke.patch { flake8 = lib.getExe python3Packages.flake8; }) @@ -154,7 +156,6 @@ let disabledTestPaths = [ # Tests require network access "tests/scrape/test_scrape.py" - "tests/basic/test_repomap.py" # Expected 'mock' to have been called once "tests/help/test_help.py" ]; @@ -164,7 +165,6 @@ let # Tests require network "test_urls" "test_get_commit_message_with_custom_prompt" - "test_cmd_tokens_output" # FileNotFoundError "test_get_commit_message" # Expected 'launch_gui' to have been called once From 8699a4f827465d744b86e9701751c404d35bb8a1 Mon Sep 17 00:00:00 2001 From: Zexin Yuan Date: Thu, 17 Jul 2025 12:18:58 +0800 Subject: [PATCH 2/3] aider-chat: 0.85.1 -> 0.85.2 --- pkgs/by-name/ai/aider-chat/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ai/aider-chat/package.nix b/pkgs/by-name/ai/aider-chat/package.nix index cd1a52b98acf..4f8c70aa4e9a 100644 --- a/pkgs/by-name/ai/aider-chat/package.nix +++ b/pkgs/by-name/ai/aider-chat/package.nix @@ -19,7 +19,7 @@ let d.stopwords ]); - version = "0.85.1"; + version = "0.85.2"; aider-chat = python3Packages.buildPythonApplication { pname = "aider-chat"; inherit version; @@ -29,7 +29,7 @@ let owner = "Aider-AI"; repo = "aider"; tag = "v${version}"; - hash = "sha256-T2v07AFhrpq9a3XEU2B2orSu0afZFUsb3FRTBcJHDoQ="; + hash = "sha256-J2xCx1edbu8mEGzNq2PKMxPCMlMZkArEwz6338Sm1tw="; }; pythonRelaxDeps = true; From d12371a516806be2b160a626e2c9f998e54b0e54 Mon Sep 17 00:00:00 2001 From: Zexin Yuan Date: Thu, 17 Jul 2025 12:19:25 +0800 Subject: [PATCH 3/3] aider-chat: update variants pname --- pkgs/by-name/ai/aider-chat/package.nix | 30 ++++++++++++++++---------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/ai/aider-chat/package.nix b/pkgs/by-name/ai/aider-chat/package.nix index 4f8c70aa4e9a..3cfc044433cf 100644 --- a/pkgs/by-name/ai/aider-chat/package.nix +++ b/pkgs/by-name/ai/aider-chat/package.nix @@ -222,15 +222,16 @@ let passthru = { withOptional = { - withPlaywright ? false, - withBrowser ? false, - withHelp ? false, - withBedrock ? false, withAll ? false, + withPlaywright ? withAll, + withBrowser ? withAll, + withHelp ? withAll, + withBedrock ? withAll, ... }: aider-chat.overridePythonAttrs ( { + pname, dependencies, makeWrapperArgs, propagatedBuildInputs ? [ ], @@ -238,20 +239,27 @@ let }: { + pname = + pname + + lib.optionalString withPlaywright "-playwright" + + lib.optionalString withBrowser "-browser" + + lib.optionalString withHelp "-help" + + lib.optionalString withBedrock "-bedrock"; + dependencies = dependencies - ++ lib.optionals (withAll || withPlaywright) aider-chat.optional-dependencies.playwright - ++ lib.optionals (withAll || withBrowser) aider-chat.optional-dependencies.browser - ++ lib.optionals (withAll || withHelp) aider-chat.optional-dependencies.help - ++ lib.optionals (withAll || withBedrock) aider-chat.optional-dependencies.bedrock; + ++ lib.optionals withPlaywright aider-chat.optional-dependencies.playwright + ++ lib.optionals withBrowser aider-chat.optional-dependencies.browser + ++ lib.optionals withHelp aider-chat.optional-dependencies.help + ++ lib.optionals withBedrock aider-chat.optional-dependencies.bedrock; propagatedBuildInputs = propagatedBuildInputs - ++ lib.optionals (withAll || withPlaywright) [ playwright-driver.browsers ]; + ++ lib.optionals withPlaywright [ playwright-driver.browsers ]; makeWrapperArgs = makeWrapperArgs - ++ lib.optionals (withAll || withPlaywright) [ + ++ lib.optionals withPlaywright [ "--set" "PLAYWRIGHT_BROWSERS_PATH" "${playwright-driver.browsers}" @@ -259,7 +267,7 @@ let "PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS" "true" ] - ++ lib.optionals (withAll || withHelp) [ + ++ lib.optionals withHelp [ "--set" "NLTK_DATA" "${aider-nltk-data}"