From e714b7ce00ca4d2bb7ab1d1b3f26af1d0ec537a0 Mon Sep 17 00:00:00 2001 From: Michael Maurer Date: Fri, 28 Feb 2025 20:23:01 -0500 Subject: [PATCH 1/3] aider-chat: add full playwright support (under withPlaywright) --- pkgs/development/python-modules/aider-chat/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/aider-chat/default.nix b/pkgs/development/python-modules/aider-chat/default.nix index 518bc74638ac..1cf0707f3118 100644 --- a/pkgs/development/python-modules/aider-chat/default.nix +++ b/pkgs/development/python-modules/aider-chat/default.nix @@ -5,6 +5,7 @@ fetchFromGitHub, gitMinimal, portaudio, + playwright-driver, }: let @@ -179,9 +180,14 @@ let passthru = { withPlaywright = aider-chat.overridePythonAttrs ( - { dependencies, ... }: + { dependencies, makeWrapperArgs, propagatedBuildInputs ? [], ... }: { dependencies = dependencies ++ aider-chat.optional-dependencies.playwright; + propagatedBuildInputs = propagatedBuildInputs ++ [ playwright-driver.browsers ]; + makeWrapperArgs = makeWrapperArgs ++ [ + "--set PLAYWRIGHT_BROWSERS_PATH ${playwright-driver.browsers}" + "--set PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true" + ]; } ); }; From 62b6f9a5151e8c5ac408eaf15d72b2f9bdad7e22 Mon Sep 17 00:00:00 2001 From: Michael Maurer Date: Fri, 28 Feb 2025 20:54:00 -0500 Subject: [PATCH 2/3] aider-chat: run nixfmt --- .../python-modules/aider-chat/default.nix | 91 ++++++++----------- 1 file changed, 38 insertions(+), 53 deletions(-) diff --git a/pkgs/development/python-modules/aider-chat/default.nix b/pkgs/development/python-modules/aider-chat/default.nix index 1cf0707f3118..462da8b3c71e 100644 --- a/pkgs/development/python-modules/aider-chat/default.nix +++ b/pkgs/development/python-modules/aider-chat/default.nix @@ -1,12 +1,5 @@ -{ - lib, - stdenv, - python312, - fetchFromGitHub, - gitMinimal, - portaudio, - playwright-driver, -}: +{ lib, stdenv, python312, fetchFromGitHub, gitMinimal, portaudio +, playwright-driver, }: let python3 = python312.override { @@ -126,7 +119,8 @@ let buildInputs = [ portaudio ]; - nativeCheckInputs = (with python3.pkgs; [ pytestCheckHook ]) ++ [ gitMinimal ]; + nativeCheckInputs = (with python3.pkgs; [ pytestCheckHook ]) + ++ [ gitMinimal ]; disabledTestPaths = [ # Tests require network access @@ -135,71 +129,62 @@ let "tests/help/test_help.py" ]; - disabledTests = - [ - # Tests require network - "test_urls" - "test_get_commit_message_with_custom_prompt" - # FileNotFoundError - "test_get_commit_message" - # Expected 'launch_gui' to have been called once - "test_browser_flag_imports_streamlit" - # AttributeError - "test_simple_send_with_retries" - # Expected 'check_version' to have been called once - "test_main_exit_calls_version_check" - # AssertionError: assert 2 == 1 - "test_simple_send_non_retryable_error" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Tests fails on darwin - "test_dark_mode_sets_code_theme" - "test_default_env_file_sets_automatic_variable" - # FileNotFoundError: [Errno 2] No such file or directory: 'vim' - "test_pipe_editor" - ]; - - makeWrapperArgs = [ - "--set AIDER_CHECK_UPDATE false" - "--set AIDER_ANALYTICS false" + disabledTests = [ + # Tests require network + "test_urls" + "test_get_commit_message_with_custom_prompt" + # FileNotFoundError + "test_get_commit_message" + # Expected 'launch_gui' to have been called once + "test_browser_flag_imports_streamlit" + # AttributeError + "test_simple_send_with_retries" + # Expected 'check_version' to have been called once + "test_main_exit_calls_version_check" + # AssertionError: assert 2 == 1 + "test_simple_send_non_retryable_error" + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Tests fails on darwin + "test_dark_mode_sets_code_theme" + "test_default_env_file_sets_automatic_variable" + # FileNotFoundError: [Errno 2] No such file or directory: 'vim' + "test_pipe_editor" ]; + makeWrapperArgs = + [ "--set AIDER_CHECK_UPDATE false" "--set AIDER_ANALYTICS false" ]; + preCheck = '' export HOME=$(mktemp -d) export AIDER_ANALYTICS="false" ''; optional-dependencies = with python3.pkgs; { - playwright = [ - greenlet - playwright - pyee - typing-extensions - ]; + playwright = [ greenlet playwright pyee typing-extensions ]; }; passthru = { - withPlaywright = aider-chat.overridePythonAttrs ( - { dependencies, makeWrapperArgs, propagatedBuildInputs ? [], ... }: - { - dependencies = dependencies ++ aider-chat.optional-dependencies.playwright; - propagatedBuildInputs = propagatedBuildInputs ++ [ playwright-driver.browsers ]; + withPlaywright = aider-chat.overridePythonAttrs + ({ dependencies, makeWrapperArgs, propagatedBuildInputs ? [ ], ... }: { + dependencies = dependencies + ++ aider-chat.optional-dependencies.playwright; + propagatedBuildInputs = propagatedBuildInputs + ++ [ playwright-driver.browsers ]; makeWrapperArgs = makeWrapperArgs ++ [ "--set PLAYWRIGHT_BROWSERS_PATH ${playwright-driver.browsers}" "--set PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true" ]; - } - ); + }); }; meta = { description = "AI pair programming in your terminal"; homepage = "https://github.com/paul-gauthier/aider"; - changelog = "https://github.com/paul-gauthier/aider/blob/v${version}/HISTORY.md"; + changelog = + "https://github.com/paul-gauthier/aider/blob/v${version}/HISTORY.md"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ happysalada ]; mainProgram = "aider"; }; }; -in -aider-chat +in aider-chat From ca52dfcb6d504a8f2c04ac143ac6ce6b873c2c56 Mon Sep 17 00:00:00 2001 From: Michael Maurer Date: Sat, 1 Mar 2025 12:06:15 -0500 Subject: [PATCH 3/3] aider-chat: run nixfmt with nixfmt-rfc-style --- .../python-modules/aider-chat/default.nix | 96 +++++++++++-------- 1 file changed, 58 insertions(+), 38 deletions(-) diff --git a/pkgs/development/python-modules/aider-chat/default.nix b/pkgs/development/python-modules/aider-chat/default.nix index 462da8b3c71e..2252ecd6d577 100644 --- a/pkgs/development/python-modules/aider-chat/default.nix +++ b/pkgs/development/python-modules/aider-chat/default.nix @@ -1,5 +1,12 @@ -{ lib, stdenv, python312, fetchFromGitHub, gitMinimal, portaudio -, playwright-driver, }: +{ + lib, + stdenv, + python312, + fetchFromGitHub, + gitMinimal, + portaudio, + playwright-driver, +}: let python3 = python312.override { @@ -119,8 +126,7 @@ let buildInputs = [ portaudio ]; - nativeCheckInputs = (with python3.pkgs; [ pytestCheckHook ]) - ++ [ gitMinimal ]; + nativeCheckInputs = (with python3.pkgs; [ pytestCheckHook ]) ++ [ gitMinimal ]; disabledTestPaths = [ # Tests require network access @@ -129,30 +135,34 @@ let "tests/help/test_help.py" ]; - disabledTests = [ - # Tests require network - "test_urls" - "test_get_commit_message_with_custom_prompt" - # FileNotFoundError - "test_get_commit_message" - # Expected 'launch_gui' to have been called once - "test_browser_flag_imports_streamlit" - # AttributeError - "test_simple_send_with_retries" - # Expected 'check_version' to have been called once - "test_main_exit_calls_version_check" - # AssertionError: assert 2 == 1 - "test_simple_send_non_retryable_error" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Tests fails on darwin - "test_dark_mode_sets_code_theme" - "test_default_env_file_sets_automatic_variable" - # FileNotFoundError: [Errno 2] No such file or directory: 'vim' - "test_pipe_editor" - ]; + disabledTests = + [ + # Tests require network + "test_urls" + "test_get_commit_message_with_custom_prompt" + # FileNotFoundError + "test_get_commit_message" + # Expected 'launch_gui' to have been called once + "test_browser_flag_imports_streamlit" + # AttributeError + "test_simple_send_with_retries" + # Expected 'check_version' to have been called once + "test_main_exit_calls_version_check" + # AssertionError: assert 2 == 1 + "test_simple_send_non_retryable_error" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Tests fails on darwin + "test_dark_mode_sets_code_theme" + "test_default_env_file_sets_automatic_variable" + # FileNotFoundError: [Errno 2] No such file or directory: 'vim' + "test_pipe_editor" + ]; - makeWrapperArgs = - [ "--set AIDER_CHECK_UPDATE false" "--set AIDER_ANALYTICS false" ]; + makeWrapperArgs = [ + "--set AIDER_CHECK_UPDATE false" + "--set AIDER_ANALYTICS false" + ]; preCheck = '' export HOME=$(mktemp -d) @@ -160,31 +170,41 @@ let ''; optional-dependencies = with python3.pkgs; { - playwright = [ greenlet playwright pyee typing-extensions ]; + playwright = [ + greenlet + playwright + pyee + typing-extensions + ]; }; passthru = { - withPlaywright = aider-chat.overridePythonAttrs - ({ dependencies, makeWrapperArgs, propagatedBuildInputs ? [ ], ... }: { - dependencies = dependencies - ++ aider-chat.optional-dependencies.playwright; - propagatedBuildInputs = propagatedBuildInputs - ++ [ playwright-driver.browsers ]; + withPlaywright = aider-chat.overridePythonAttrs ( + { + dependencies, + makeWrapperArgs, + propagatedBuildInputs ? [ ], + ... + }: + { + dependencies = dependencies ++ aider-chat.optional-dependencies.playwright; + propagatedBuildInputs = propagatedBuildInputs ++ [ playwright-driver.browsers ]; makeWrapperArgs = makeWrapperArgs ++ [ "--set PLAYWRIGHT_BROWSERS_PATH ${playwright-driver.browsers}" "--set PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true" ]; - }); + } + ); }; meta = { description = "AI pair programming in your terminal"; homepage = "https://github.com/paul-gauthier/aider"; - changelog = - "https://github.com/paul-gauthier/aider/blob/v${version}/HISTORY.md"; + changelog = "https://github.com/paul-gauthier/aider/blob/v${version}/HISTORY.md"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ happysalada ]; mainProgram = "aider"; }; }; -in aider-chat +in +aider-chat