Skip to content

Commit

Permalink
Bullseye (#3008)
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw authored Jan 13, 2025
1 parent d7199e5 commit a03f1f7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libs/cli/langgraph_cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Config(TypedDict, total=False):
def _parse_version(version_str: str) -> tuple[int, int]:
"""Parse a version string into a tuple of (major, minor)."""
try:
major, minor = map(int, version_str.split("."))
major, minor = map(int, version_str.split("-")[0].split("."))
return (major, minor)
except ValueError:
raise click.UsageError(f"Invalid version format: {version_str}") from None
Expand Down Expand Up @@ -159,7 +159,7 @@ def validate_config(config: Config) -> Config:
if config.get("python_version"):
pyversion = config["python_version"]
if not pyversion.count(".") == 1 or not all(
part.isdigit() for part in pyversion.split(".")
part.isdigit() for part in pyversion.split("-")[0].split(".")
):
raise click.UsageError(
f"Invalid Python version format: {pyversion}. "
Expand Down
2 changes: 1 addition & 1 deletion libs/cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langgraph-cli"
version = "0.1.65"
version = "0.1.66"
description = "CLI for interacting with LangGraph API"
authors = []
license = "MIT"
Expand Down
6 changes: 6 additions & 0 deletions libs/cli/tests/unit_tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ def test_validate_config():
validate_config({"python_version": "3.10"})
assert "Minimum required version" in str(exc_info.value)

config = validate_config({"python_version": "3.11-bullseye", "dependencies": ["."], "graphs": {"agent": "./agent.py:graph"}})
assert config["python_version"] == "3.11-bullseye"

config = validate_config({"python_version": "3.12-slim", "dependencies": ["."], "graphs": {"agent": "./agent.py:graph"}})
assert config["python_version"] == "3.12-slim"


def test_validate_config_file():
with tempfile.TemporaryDirectory() as tmpdir:
Expand Down

0 comments on commit a03f1f7

Please sign in to comment.