Skip to content

Commit

Permalink
Update dev
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw committed Dec 14, 2024
1 parent dbf5b49 commit 70f2efc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
21 changes: 12 additions & 9 deletions libs/cli/langgraph_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,16 +576,18 @@ def dev(
from langgraph_api.cli import run_server
except ImportError:
try:
import pkg_resources

pkg_resources.require("langgraph-api-inmem")
except (ImportError, pkg_resources.DistributionNotFound):
from importlib import util

if not util.find_spec("langgraph_api"):
raise click.UsageError(
"Required package 'langgraph-api' is not installed.\n"
"Please install it with:\n\n"
' pip install -U "langgraph-cli[inmem]"\n\n'
) from None
except ImportError:
raise click.UsageError(
"Required package 'langgraph-api-inmem' is not installed.\n"
"Please install it with:\n\n"
' pip install -U "langgraph-cli[inmem]"\n\n'
"If you're developing the langgraph-cli package locally, you can install in development mode:\n"
" pip install -e ."
"Could not verify package installation. Please ensure Python is up to date and\n"
"langgraph-cli is installed with the 'inmem' extra: pip install -U \"langgraph-cli[inmem]\""
) from None
raise click.UsageError(
"Could not import run_server. This likely means your installation is incomplete.\n"
Expand Down Expand Up @@ -614,6 +616,7 @@ def dev(
env=config_json.get("env"),
store=config_json.get("store"),
wait_for_client=wait_for_client,
auth=config_json.get("auth"),
)


Expand Down
2 changes: 1 addition & 1 deletion libs/cli/langgraph_cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Config(TypedDict, total=False):
graphs: dict[str, str]
env: Union[dict[str, str], str]
store: Optional[StoreConfig]
auth: Optional[dict[str, str]]
auth: Optional[AuthConfig]


def _parse_version(version_str: str) -> tuple[int, int]:
Expand Down
2 changes: 2 additions & 0 deletions libs/cli/tests/unit_tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def test_validate_config():
"dockerfile_lines": [],
"env": {},
"store": None,
"auth": None,
**expected_config,
}
actual_config = validate_config(expected_config)
Expand All @@ -48,6 +49,7 @@ def test_validate_config():
},
"env": env,
"store": None,
"auth": None,
}
actual_config = validate_config(expected_config)
assert actual_config == expected_config
Expand Down

0 comments on commit 70f2efc

Please sign in to comment.