diff --git a/.gitignore b/.gitignore index 94b0f3bce..f8e893740 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ hs_err_pid* /findbugs/ /target/ **/.swarm/ +**/.venv #intellij .idea/ diff --git a/shell.nix b/shell.nix new file mode 100644 index 000000000..5a9fa437d --- /dev/null +++ b/shell.nix @@ -0,0 +1,18 @@ +let + pkgs = import {}; + lib-path = with pkgs; + lib.makeLibraryPath [ + stdenv.cc.cc + ]; +in + pkgs.mkShell { + packages = with pkgs; [ + python312 + (poetry.override {python3 = python312;}) + uv + ]; + + shellHook = '' + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${lib-path} + ''; + } diff --git a/venv.sh b/venv.sh new file mode 100644 index 000000000..2d34b5d60 --- /dev/null +++ b/venv.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env zsh + +# This code will set up the Python environment for running this code. + +# Run this code by typing `nix-shell`, then `source venv.sh`. Note that +# running `venv.sh` without `source` will only install everything; it will +# not change your terminal to use the correct environment. + +python -m venv .venv +source .venv/bin/activate + +pip install -e . +pip install click 'rx>=3.2.0' jinja2 pystache pyyaml 'langchain-core>=0.3.0' 'langchain-openai>=0.2.0' 'langchain-anthropic>=0.2.0' 'langchain-google-genai>=2.0.0' aiohttp + +export PYTHONPATH=$(pwd)/src:$PYTHONPATH