[CLI] Python path (#2531)

This commit is contained in:
William FH
2024-11-25 11:59:49 -08:00
committed by GitHub
parent 486d5412af
commit 328ef609af
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -1,3 +1,4 @@
import os
import pathlib
import shutil
import sys
@@ -598,6 +599,13 @@ def dev(
) from None
config_json = langgraph_cli.config.validate_config_file(config)
cwd = os.getcwd()
sys.path.append(cwd)
dependencies = config_json.get("dependencies", [])
for dep in dependencies:
dep_path = pathlib.Path(cwd) / dep
if dep_path.is_dir() and dep_path.exists():
sys.path.append(str(dep_path))
graphs = config_json.get("graphs", {})
run_server(