From f633affd146b1217482664f0bdb6ec9652220cd8 Mon Sep 17 00:00:00 2001 From: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com> Date: Fri, 31 Oct 2025 14:23:54 -0700 Subject: [PATCH] Update check for prerelease installs --- .github/scripts/run_langgraph_cli_test.py | 38 +++++++++++++------ .github/workflows/_integration_test.yml | 19 ++++++---- .../examples/graph_prerelease_reqs/agent.py | 3 +- .../deps/additional_deps/pyproject.toml | 2 +- .../deps/zuper_deps/pyproject.toml | 2 +- .../graph_prerelease_reqs/pyproject.toml | 6 +-- 6 files changed, 44 insertions(+), 26 deletions(-) diff --git a/.github/scripts/run_langgraph_cli_test.py b/.github/scripts/run_langgraph_cli_test.py index 872b86f65..ac89c838f 100644 --- a/.github/scripts/run_langgraph_cli_test.py +++ b/.github/scripts/run_langgraph_cli_test.py @@ -10,6 +10,10 @@ from langgraph_cli.cli import prepare_args_and_stdin from langgraph_cli.constants import DEFAULT_PORT from langgraph_cli.exec import Runner, subp_exec from langgraph_cli.progress import Progress +import logging + +logger = logging.getLogger(__name__) +logging.basicConfig(level=logging.INFO) def test(config: pathlib.Path, port: int, tag: str, verbose: bool): @@ -57,7 +61,9 @@ def test(config: pathlib.Path, port: int, tag: str, verbose: bool): sys.stderr.write(f"docker compose up failed: {e}\n") try: sys.stderr.write("\n== docker compose ps ==\n") - runner.run(subp_exec(*compose_cmd, *args, "ps", input=stdin, verbose=False)) + runner.run( + subp_exec(*compose_cmd, *args, "ps", input=stdin, verbose=False) + ) except Exception: pass try: @@ -93,7 +99,7 @@ def test(config: pathlib.Path, port: int, tag: str, verbose: bool): set("") base_url = f"http://localhost:{port}" ok_url = f"{base_url}/ok" - print(f"Waiting for {ok_url} to respond with 200...") + logger.info(f"Waiting for {ok_url} to respond with 200...") deadline = time.time() + 30 last_err: Exception | None = None while time.time() < deadline: @@ -107,13 +113,16 @@ def test(config: pathlib.Path, port: int, tag: str, verbose: bool): break else: last_err = RuntimeError(f"Unexpected status: {resp.status}") - print(f"Unexpected status: {resp.status}") + logger.error(f"Unexpected status: {resp.status}") except error.URLError as e: + logger.error(f"URLError: {e}") last_err = e except Exception as e: # noqa: BLE001 + logger.error(f"Exception: {e}") last_err = e time.sleep(0.5) else: + logger.error("Timeout waiting for /ok to return 200") # Bring stack down before raising args_down = [*args, "down", "-v", "--remove-orphans"] try: @@ -131,15 +140,22 @@ def test(config: pathlib.Path, port: int, tag: str, verbose: bool): ) # Clean up: bring compose stack down to free ports for next test - args_down = [*args, "down", "-v", "--remove-orphans"] - runner.run( - subp_exec( - *compose_cmd, - *args_down, - input=stdin, - verbose=verbose, + logger.info("Test succeeded. Bringing down compose stack...") + try: + args_down = [*args, "down", "-v", "--remove-orphans"] + runner.run( + subp_exec( + *compose_cmd, + *args_down, + input=stdin, + verbose=verbose, + ) ) - ) + logger.info("Compose stack down. Finishing...") + except Exception: + logger.exception("Failed to bring down compose stack") + pass + logger.info("Test finished") if __name__ == "__main__": diff --git a/.github/workflows/_integration_test.yml b/.github/workflows/_integration_test.yml index 3924cdc9f..2a1533334 100644 --- a/.github/workflows/_integration_test.yml +++ b/.github/workflows/_integration_test.yml @@ -13,7 +13,6 @@ jobs: matrix: python-version: - "3.10" - - "3.11" - "3.14" example: - name: A @@ -67,19 +66,19 @@ jobs: timeout 60 python "$REPO_ROOT/.github/scripts/run_langgraph_cli_test.py" -t ${{ matrix.example.tag }} - name: Build JS service - if: steps.changed-files.outputs.all + if: ${{ steps.changed-files.outputs.all && matrix.example.name == 'A' }} working-directory: libs/cli/js-examples run: | langgraph build -t langgraph-test-e - name: Build JS monorepo service - if: steps.changed-files.outputs.all + if: ${{ steps.changed-files.outputs.all && matrix.example.name == 'A' }} working-directory: libs/cli/js-monorepo-example run: | langgraph build -t langgraph-test-f -c apps/agent/langgraph.json --build-command "yarn run turbo build" --install-command "yarn install" - name: Build Python monorepo service - if: steps.changed-files.outputs.all + if: ${{ steps.changed-files.outputs.all && matrix.example.name == 'A' }} working-directory: libs/cli/python-monorepo-example run: | langgraph build -t langgraph-test-g -c apps/agent/langgraph.json @@ -88,7 +87,7 @@ jobs: timeout 60 python ../../../.github/scripts/run_langgraph_cli_test.py -t langgraph-test-g -c apps/agent/langgraph.json - name: Build and test prerelease reqs service - if: steps.changed-files.outputs.all + if: ${{ steps.changed-files.outputs.all && matrix.example.name == 'A' }} working-directory: libs/cli/examples/graph_prerelease_reqs run: | langgraph build -t langgraph-test-h @@ -96,16 +95,20 @@ jobs: if [ -n "${{ secrets.LANGSMITH_API_KEY }}" ]; then echo "LANGSMITH_API_KEY=${{ secrets.LANGSMITH_API_KEY }}" >> .env; fi timeout 60 python ../../../../.github/scripts/run_langgraph_cli_test.py -t langgraph-test-h LANGGRAPH_VERSION=$(docker run --rm --entrypoint "" langgraph-test-h python -c "import sys; from importlib.metadata import version; v = version('langgraph'); print(v);") - if [ "$LANGGRAPH_VERSION" != "1.0.0a2" ]; then + if [ "$LANGGRAPH_VERSION" != "1.0.2" ]; then exit 1 fi LANGCHAIN_OPENAI_VERSION=$(docker run --rm --entrypoint "" langgraph-test-h python -c "import sys; from importlib.metadata import version; v = version('langchain-openai'); print(v);") - if [ "$LANGCHAIN_OPENAI_VERSION" != "0.3.0" ]; then + if [ "$LANGCHAIN_OPENAI_VERSION" != "1.0.1" ]; then + exit 1 + fi + LANGCHAIN_ANTHROPIC_VERSION=$(docker run --rm --entrypoint "" langgraph-test-h python -c "import sys; from importlib.metadata import version; v = version('langchain-anthropic'); print(v);") + if [ "$LANGCHAIN_ANTHROPIC_VERSION" != "1.0.0.a5" ]; then exit 1 fi - name: Build and test prerelease reqs fail service - if: steps.changed-files.outputs.all + if: ${{ steps.changed-files.outputs.all && matrix.example.name == 'A' }} working-directory: libs/cli/examples/graph_prerelease_reqs_fail run: | langgraph build -t langgraph-test-i || [ $? -eq 1 ] diff --git a/libs/cli/examples/graph_prerelease_reqs/agent.py b/libs/cli/examples/graph_prerelease_reqs/agent.py index 4801c7c0b..57d8543a2 100644 --- a/libs/cli/examples/graph_prerelease_reqs/agent.py +++ b/libs/cli/examples/graph_prerelease_reqs/agent.py @@ -1,13 +1,12 @@ from collections.abc import Sequence from typing import Annotated, Literal, TypedDict -from langchain_community.tools.tavily_search import TavilySearchResults from langchain_core.messages import BaseMessage from langchain_openai import ChatOpenAI from langgraph.graph import END, StateGraph, add_messages from langgraph.prebuilt import ToolNode -tools = [TavilySearchResults(max_results=1)] +tools = [] model_oai = ChatOpenAI(temperature=0) diff --git a/libs/cli/examples/graph_prerelease_reqs/deps/additional_deps/pyproject.toml b/libs/cli/examples/graph_prerelease_reqs/deps/additional_deps/pyproject.toml index 10bb866df..c68fdf561 100644 --- a/libs/cli/examples/graph_prerelease_reqs/deps/additional_deps/pyproject.toml +++ b/libs/cli/examples/graph_prerelease_reqs/deps/additional_deps/pyproject.toml @@ -5,5 +5,5 @@ description = "Test for prerelease stuff" readme = "README.md" requires-python = ">=3.10" dependencies = [ - "langgraph==0.6.11" + "langgraph==1.0.2" ] \ No newline at end of file diff --git a/libs/cli/examples/graph_prerelease_reqs/deps/zuper_deps/pyproject.toml b/libs/cli/examples/graph_prerelease_reqs/deps/zuper_deps/pyproject.toml index 2679347cb..f5ea6f2a6 100644 --- a/libs/cli/examples/graph_prerelease_reqs/deps/zuper_deps/pyproject.toml +++ b/libs/cli/examples/graph_prerelease_reqs/deps/zuper_deps/pyproject.toml @@ -5,5 +5,5 @@ description = "Test for prerelease stuff" readme = "README.md" requires-python = ">=3.10" dependencies = [ - "langchain-openai==0.3.0" + "langchain-openai==1.0.0" ] \ No newline at end of file diff --git a/libs/cli/examples/graph_prerelease_reqs/pyproject.toml b/libs/cli/examples/graph_prerelease_reqs/pyproject.toml index 05e5da1d3..35ea2e6e5 100644 --- a/libs/cli/examples/graph_prerelease_reqs/pyproject.toml +++ b/libs/cli/examples/graph_prerelease_reqs/pyproject.toml @@ -6,9 +6,9 @@ readme = "README.md" requires-python = ">=3.10" dependencies = [ "langchain-openai==1.0.0a2", - "langgraph==1.0.0a2", - "langchain_community>=0.3.0", + "langchain-anthropic==1.0.0.a5", + "langgraph==1.0.2" ] [tool.uv] -prerelease = "allow" \ No newline at end of file +prerelease = "allow"