From a03f1f74692ec078a7affa57415744df5950ed2c Mon Sep 17 00:00:00 2001 From: William FH <13333726+hinthornw@users.noreply.github.com> Date: Mon, 13 Jan 2025 10:01:36 -0800 Subject: [PATCH] Bullseye (#3008) --- libs/cli/langgraph_cli/config.py | 4 ++-- libs/cli/pyproject.toml | 2 +- libs/cli/tests/unit_tests/test_config.py | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libs/cli/langgraph_cli/config.py b/libs/cli/langgraph_cli/config.py index 57d2ccadd..6fb6b309a 100644 --- a/libs/cli/langgraph_cli/config.py +++ b/libs/cli/langgraph_cli/config.py @@ -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 @@ -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}. " diff --git a/libs/cli/pyproject.toml b/libs/cli/pyproject.toml index 9bf91012d..7e166ee25 100644 --- a/libs/cli/pyproject.toml +++ b/libs/cli/pyproject.toml @@ -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" diff --git a/libs/cli/tests/unit_tests/test_config.py b/libs/cli/tests/unit_tests/test_config.py index bd4cb881c..6bbc12aab 100644 --- a/libs/cli/tests/unit_tests/test_config.py +++ b/libs/cli/tests/unit_tests/test_config.py @@ -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: