Commit fca13125 authored by Chun Yu's avatar Chun Yu
Browse files

python3Packages.aider-chat: add optional dependencies

parent 9794620a
Loading
Loading
Loading
Loading
+43 −0
Original line number Diff line number Diff line
@@ -177,6 +177,14 @@ let
        pyee
        typing-extensions
      ];
      browser = [
        streamlit
      ];
      help = [
        llama-index-core
        llama-index-embeddings-huggingface
        torch
      ];
    };

    passthru = {
@@ -196,6 +204,41 @@ let
          ];
        }
      );

      withBrowser = aider-chat.overridePythonAttrs (
        { dependencies, ... }:
        {
          dependencies = dependencies ++ aider-chat.optional-dependencies.browser;
        }
      );

      withHelp = aider-chat.overridePythonAttrs (
        { dependencies, ... }:
        {
          dependencies = dependencies ++ aider-chat.optional-dependencies.help;
        }
      );

      withOptional = aider-chat.overridePythonAttrs (
        {
          dependencies,
          makeWrapperArgs,
          propagatedBuildInputs ? [ ],
          ...
        }:
        {
          dependencies =
            dependencies
            ++ aider-chat.optional-dependencies.playwright
            ++ aider-chat.optional-dependencies.browser
            ++ aider-chat.optional-dependencies.help;
          propagatedBuildInputs = propagatedBuildInputs ++ [ playwright-driver.browsers ];
          makeWrapperArgs = makeWrapperArgs ++ [
            "--set PLAYWRIGHT_BROWSERS_PATH ${playwright-driver.browsers}"
            "--set PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true"
          ];
        }
      );
    };

    meta = {