From d933d455ecc033306c689e73f4f8cf1b8ff6af89 Mon Sep 17 00:00:00 2001 From: Isaac Francisco <78627776+isahers1@users.noreply.github.com> Date: Wed, 24 Sep 2025 09:54:24 -0700 Subject: [PATCH] fix(cli): change prerelease behavior (#6156) respect users config, use uv defaults --- .github/workflows/_integration_test.yml | 14 +++ .../examples/graph_prerelease_reqs/agent.py | 8 +- .../deps/additional_deps/pyproject.toml | 9 ++ .../deps/zuper_deps/pyproject.toml | 9 ++ .../graph_prerelease_reqs/langgraph.json | 4 +- .../graph_prerelease_reqs/pyproject.toml | 14 +++ .../graph_prerelease_reqs/requirements.txt | 6 -- .../graph_prerelease_reqs_fail/agent.py | 89 +++++++++++++++++++ .../graph_prerelease_reqs_fail/langgraph.json | 11 +++ .../graph_prerelease_reqs_fail/pyproject.toml | 11 +++ libs/cli/langgraph_cli/config.py | 26 ++++-- libs/cli/tests/unit_tests/cli/test_cli.py | 4 +- libs/cli/tests/unit_tests/test_config.py | 42 ++++----- 13 files changed, 204 insertions(+), 43 deletions(-) create mode 100644 libs/cli/examples/graph_prerelease_reqs/deps/additional_deps/pyproject.toml create mode 100644 libs/cli/examples/graph_prerelease_reqs/deps/zuper_deps/pyproject.toml create mode 100644 libs/cli/examples/graph_prerelease_reqs/pyproject.toml delete mode 100644 libs/cli/examples/graph_prerelease_reqs/requirements.txt create mode 100644 libs/cli/examples/graph_prerelease_reqs_fail/agent.py create mode 100644 libs/cli/examples/graph_prerelease_reqs_fail/langgraph.json create mode 100644 libs/cli/examples/graph_prerelease_reqs_fail/pyproject.toml diff --git a/.github/workflows/_integration_test.yml b/.github/workflows/_integration_test.yml index 5655ae9e9..b5b1886af 100644 --- a/.github/workflows/_integration_test.yml +++ b/.github/workflows/_integration_test.yml @@ -94,3 +94,17 @@ jobs: cp ../.env.example .env 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 + 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 + exit 1 + fi + + - name: Build and test prerelease reqs fail service + if: steps.changed-files.outputs.all + 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 b33b1a5d3..4801c7c0b 100644 --- a/libs/cli/examples/graph_prerelease_reqs/agent.py +++ b/libs/cli/examples/graph_prerelease_reqs/agent.py @@ -1,7 +1,6 @@ from collections.abc import Sequence from typing import Annotated, Literal, TypedDict -from langchain.chat_models import init_chat_model from langchain_community.tools.tavily_search import TavilySearchResults from langchain_core.messages import BaseMessage from langchain_openai import ChatOpenAI @@ -10,10 +9,8 @@ from langgraph.prebuilt import ToolNode tools = [TavilySearchResults(max_results=1)] -model_anth = init_chat_model("claude-3-7-sonnet-20250219", model_provider="anthropic") model_oai = ChatOpenAI(temperature=0) -model_anth = model_anth.bind_tools(tools) model_oai = model_oai.bind_tools(tools) @@ -35,10 +32,7 @@ def should_continue(state): # Define the function that calls the model def call_model(state, config): - if config["configurable"].get("model", "anthropic") == "anthropic": - model = model_anth - else: - model = model_oai + model = model_oai messages = state["messages"] response = model.invoke(messages) # We return a list, because this will get added to the existing list 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 new file mode 100644 index 000000000..39e1ee42d --- /dev/null +++ b/libs/cli/examples/graph_prerelease_reqs/deps/additional_deps/pyproject.toml @@ -0,0 +1,9 @@ +[project] +name = "graph-prerelease-reqs-additional-deps" +version = "0.1.0" +description = "Test for prerelease stuff" +readme = "README.md" +requires-python = ">=3.10" +dependencies = [ + "langgraph==0.6.0" +] \ 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 new file mode 100644 index 000000000..2679347cb --- /dev/null +++ b/libs/cli/examples/graph_prerelease_reqs/deps/zuper_deps/pyproject.toml @@ -0,0 +1,9 @@ +[project] +name = "graph-prerelease-reqs-zuper-deps" +version = "0.1.0" +description = "Test for prerelease stuff" +readme = "README.md" +requires-python = ">=3.10" +dependencies = [ + "langchain-openai==0.3.0" +] \ No newline at end of file diff --git a/libs/cli/examples/graph_prerelease_reqs/langgraph.json b/libs/cli/examples/graph_prerelease_reqs/langgraph.json index 8bc7d8b2c..6d3a7b92b 100644 --- a/libs/cli/examples/graph_prerelease_reqs/langgraph.json +++ b/libs/cli/examples/graph_prerelease_reqs/langgraph.json @@ -1,7 +1,9 @@ { "python_version": "3.12", "dependencies": [ - "." + ".", + "./deps/additional_deps", + "./deps/zuper_deps" ], "graphs": { "agent": "./agent.py:graph" diff --git a/libs/cli/examples/graph_prerelease_reqs/pyproject.toml b/libs/cli/examples/graph_prerelease_reqs/pyproject.toml new file mode 100644 index 000000000..05e5da1d3 --- /dev/null +++ b/libs/cli/examples/graph_prerelease_reqs/pyproject.toml @@ -0,0 +1,14 @@ +[project] +name = "graph-prerelease-reqs" +version = "0.1.0" +description = "Test for prerelease stuff" +readme = "README.md" +requires-python = ">=3.10" +dependencies = [ + "langchain-openai==1.0.0a2", + "langgraph==1.0.0a2", + "langchain_community>=0.3.0", +] + +[tool.uv] +prerelease = "allow" \ No newline at end of file diff --git a/libs/cli/examples/graph_prerelease_reqs/requirements.txt b/libs/cli/examples/graph_prerelease_reqs/requirements.txt deleted file mode 100644 index 92e4c3b5c..000000000 --- a/libs/cli/examples/graph_prerelease_reqs/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -requests -langchain_anthropic -langchain_openai -langchain_community -langchain -langgraph==1.0.0a2 \ No newline at end of file diff --git a/libs/cli/examples/graph_prerelease_reqs_fail/agent.py b/libs/cli/examples/graph_prerelease_reqs_fail/agent.py new file mode 100644 index 000000000..4801c7c0b --- /dev/null +++ b/libs/cli/examples/graph_prerelease_reqs_fail/agent.py @@ -0,0 +1,89 @@ +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)] + +model_oai = ChatOpenAI(temperature=0) + +model_oai = model_oai.bind_tools(tools) + + +class AgentState(TypedDict): + messages: Annotated[Sequence[BaseMessage], add_messages] + + +# Define the function that determines whether to continue or not +def should_continue(state): + messages = state["messages"] + last_message = messages[-1] + # If there are no tool calls, then we finish + if not last_message.tool_calls: + return "end" + # Otherwise if there is, we continue + else: + return "continue" + + +# Define the function that calls the model +def call_model(state, config): + model = model_oai + messages = state["messages"] + response = model.invoke(messages) + # We return a list, because this will get added to the existing list + return {"messages": [response]} + + +# Define the function to execute tools +tool_node = ToolNode(tools) + + +class ContextSchema(TypedDict): + model: Literal["anthropic", "openai"] + + +# Define a new graph +workflow = StateGraph(AgentState, context_schema=ContextSchema) + +# Define the two nodes we will cycle between +workflow.add_node("agent", call_model) +workflow.add_node("action", tool_node) + +# Set the entrypoint as `agent` +# This means that this node is the first one called +workflow.set_entry_point("agent") + +# We now add a conditional edge +workflow.add_conditional_edges( + # First, we define the start node. We use `agent`. + # This means these are the edges taken after the `agent` node is called. + "agent", + # Next, we pass in the function that will determine which node is called next. + should_continue, + # Finally we pass in a mapping. + # The keys are strings, and the values are other nodes. + # END is a special node marking that the graph should finish. + # What will happen is we will call `should_continue`, and then the output of that + # will be matched against the keys in this mapping. + # Based on which one it matches, that node will then be called. + { + # If `tools`, then we call the tool node. + "continue": "action", + # Otherwise we finish. + "end": END, + }, +) + +# We now add a normal edge from `tools` to `agent`. +# This means that after `tools` is called, `agent` node is called next. +workflow.add_edge("action", "agent") + +# Finally, we compile it! +# This compiles it into a LangChain Runnable, +# meaning you can use it as you would any other runnable +graph = workflow.compile() diff --git a/libs/cli/examples/graph_prerelease_reqs_fail/langgraph.json b/libs/cli/examples/graph_prerelease_reqs_fail/langgraph.json new file mode 100644 index 000000000..8bc7d8b2c --- /dev/null +++ b/libs/cli/examples/graph_prerelease_reqs_fail/langgraph.json @@ -0,0 +1,11 @@ +{ + "python_version": "3.12", + "dependencies": [ + "." + ], + "graphs": { + "agent": "./agent.py:graph" + }, + "env": "../.env" + } + \ No newline at end of file diff --git a/libs/cli/examples/graph_prerelease_reqs_fail/pyproject.toml b/libs/cli/examples/graph_prerelease_reqs_fail/pyproject.toml new file mode 100644 index 000000000..27933649b --- /dev/null +++ b/libs/cli/examples/graph_prerelease_reqs_fail/pyproject.toml @@ -0,0 +1,11 @@ +[project] +name = "graph-prerelease-reqs" +version = "0.1.0" +description = "Test for prerelease stuff" +readme = "README.md" +requires-python = ">=3.10" +dependencies = [ + "langchain-openai==1.0.0a2", + "langgraph==1.0.0a2", + "langchain_community>=0.3.0", +] \ No newline at end of file diff --git a/libs/cli/langgraph_cli/config.py b/libs/cli/langgraph_cli/config.py index 9b6986eca..3b47788eb 100644 --- a/libs/cli/langgraph_cli/config.py +++ b/libs/cli/langgraph_cli/config.py @@ -1268,16 +1268,22 @@ def python_config_to_docker( else: pip_installer = "pip" if pip_installer == "uv": - install_cmd = "uv pip install --system --prerelease=allow" + install_cmd = "uv pip install --system" elif pip_installer == "pip": install_cmd = "pip install" else: raise ValueError(f"Invalid pip_installer: {pip_installer}") # configure pip - pip_install = f"PYTHONDONTWRITEBYTECODE=1 {install_cmd} --no-cache-dir -c /api/constraints.txt" + local_reqs_pip_install = f"PYTHONDONTWRITEBYTECODE=1 {install_cmd} --no-cache-dir -c /api/constraints.txt" + global_reqs_pip_install = f"PYTHONDONTWRITEBYTECODE=1 {install_cmd} --no-cache-dir -c /api/constraints.txt" if config.get("pip_config_file"): - pip_install = f"PIP_CONFIG_FILE=/pipconfig.txt {pip_install}" + local_reqs_pip_install = ( + f"PIP_CONFIG_FILE=/pipconfig.txt {local_reqs_pip_install}" + ) + global_reqs_pip_install = ( + f"PIP_CONFIG_FILE=/pipconfig.txt {global_reqs_pip_install}" + ) pip_config_file_str = ( f"ADD {config['pip_config_file']} /pipconfig.txt" if config.get("pip_config_file") @@ -1294,7 +1300,9 @@ def python_config_to_docker( # Rewrite HTTP app path, so it points to the correct location in the Docker container _update_http_app_path(config_path, config, local_deps) - pip_pkgs_str = f"RUN {pip_install} {' '.join(pypi_deps)}" if pypi_deps else "" + pip_pkgs_str = ( + f"RUN {local_reqs_pip_install} {' '.join(pypi_deps)}" if pypi_deps else "" + ) if local_deps.pip_reqs: pip_reqs_str = os.linesep.join( ( @@ -1304,7 +1312,7 @@ def python_config_to_docker( ) for reqpath, destpath in local_deps.pip_reqs ) - pip_reqs_str += f"{os.linesep}RUN {pip_install} {' '.join('-r ' + r for _, r in local_deps.pip_reqs)}" + pip_reqs_str += f"{os.linesep}RUN {local_reqs_pip_install} {' '.join('-r ' + r for _, r in local_deps.pip_reqs)}" pip_reqs_str = f"""# -- Installing local requirements -- {pip_reqs_str} # -- End of local requirements install --""" @@ -1414,7 +1422,13 @@ ADD {relpath} /deps/{name} installs, "", "# -- Installing all local dependencies --", - f"RUN {pip_install} -e /deps/*", + f"""RUN for dep in /deps/*; do \ + echo "Installing $dep"; \ + if [ -d "$dep" ]; then \ + echo "Installing $dep"; \ + (cd "$dep" && {global_reqs_pip_install} .); \ + fi; \ + done""", "# -- End of local dependencies install --", os.linesep.join(env_vars), "", diff --git a/libs/cli/tests/unit_tests/cli/test_cli.py b/libs/cli/tests/unit_tests/cli/test_cli.py index 6b1fca6ed..a16e31dcf 100644 --- a/libs/cli/tests/unit_tests/cli/test_cli.py +++ b/libs/cli/tests/unit_tests/cli/test_cli.py @@ -15,7 +15,7 @@ from langgraph_cli.docker import DEFAULT_POSTGRES_URI, DockerCapabilities, Versi from langgraph_cli.util import clean_empty_lines FORMATTED_CLEANUP_LINES = _get_pip_cleanup_lines( - install_cmd="uv pip install --system --prerelease=allow", + install_cmd="uv pip install --system", to_uninstall=("pip", "setuptools", "wheel"), pip_installer="uv", ) @@ -149,7 +149,7 @@ services: COPY --from=cli_1 . /deps/cli_1 # -- End of local package ../../.. -- # -- Installing all local dependencies -- - RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --prerelease=allow --no-cache-dir -c /api/constraints.txt -e /deps/* + RUN for dep in /deps/*; do echo "Installing $dep"; if [ -d "$dep" ]; then echo "Installing $dep"; (cd "$dep" && PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt .); fi; done # -- End of local dependencies install -- ENV LANGSERVE_GRAPHS='{{"agent": "agent.py:graph"}}' {textwrap.indent(textwrap.dedent(FORMATTED_CLEANUP_LINES), " ")} diff --git a/libs/cli/tests/unit_tests/test_config.py b/libs/cli/tests/unit_tests/test_config.py index 3b3efb6ec..733e74dbf 100644 --- a/libs/cli/tests/unit_tests/test_config.py +++ b/libs/cli/tests/unit_tests/test_config.py @@ -20,7 +20,7 @@ from langgraph_cli.config import ( from langgraph_cli.util import clean_empty_lines FORMATTED_CLEANUP_LINES = _get_pip_cleanup_lines( - install_cmd="uv pip install --system --prerelease=allow", + install_cmd="uv pip install --system", to_uninstall=("pip", "setuptools", "wheel"), pip_installer="uv", ) @@ -422,7 +422,7 @@ def test_config_to_docker_simple(): FROM langchain/langgraph-api:3.11 # -- Installing local requirements -- COPY --from=outer-requirements.txt requirements.txt /deps/outer-graphs_reqs_a/graphs_reqs_a/requirements.txt -RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --prerelease=allow --no-cache-dir -c /api/constraints.txt -r /deps/outer-graphs_reqs_a/graphs_reqs_a/requirements.txt +RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt -r /deps/outer-graphs_reqs_a/graphs_reqs_a/requirements.txt # -- End of local requirements install -- # -- Adding local package ../../examples -- COPY --from=examples . /deps/examples @@ -456,7 +456,7 @@ RUN set -ex && \\ done # -- End of non-package dependency graphs_reqs_a -- # -- Installing all local dependencies -- -RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --prerelease=allow --no-cache-dir -c /api/constraints.txt -e /deps/* +RUN for dep in /deps/*; do echo "Installing $dep"; if [ -d "$dep" ]; then echo "Installing $dep"; (cd "$dep" && PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt .); fi; done # -- End of local dependencies install -- ENV LANGGRAPH_HTTP='{{"app": "/deps/examples/my_app.py:app"}}' ENV LANGSERVE_GRAPHS='{{"agent": "/deps/outer-unit_tests/unit_tests/agent.py:graph"}}' @@ -512,7 +512,7 @@ RUN set -ex && \\ done # -- End of non-package dependency tests -- # -- Installing all local dependencies -- -RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --prerelease=allow --no-cache-dir -c /api/constraints.txt -e /deps/* +RUN for dep in /deps/*; do echo "Installing $dep"; if [ -d "$dep" ]; then echo "Installing $dep"; (cd "$dep" && PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt .); fi; done # -- End of local dependencies install -- ENV LANGSERVE_GRAPHS='{"agent": "/deps/outer-unit_tests/unit_tests/agent.py:graph"}' """ @@ -559,7 +559,7 @@ RUN set -ex && \\ done # -- End of non-package dependency unit_tests -- # -- Installing all local dependencies -- -RUN PIP_CONFIG_FILE=/pipconfig.txt PYTHONDONTWRITEBYTECODE=1 uv pip install --system --prerelease=allow --no-cache-dir -c /api/constraints.txt -e /deps/* +RUN for dep in /deps/*; do echo "Installing $dep"; if [ -d "$dep" ]; then echo "Installing $dep"; (cd "$dep" && PIP_CONFIG_FILE=/pipconfig.txt PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt .); fi; done # -- End of local dependencies install -- ENV LANGSERVE_GRAPHS='{"agent": "/deps/outer-unit_tests/unit_tests/agent.py:graph"}' """ @@ -621,7 +621,7 @@ RUN set -ex && \\ done # -- End of non-package dependency graphs -- # -- Installing all local dependencies -- -RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --prerelease=allow --no-cache-dir -c /api/constraints.txt -e /deps/* +RUN for dep in /deps/*; do echo "Installing $dep"; if [ -d "$dep" ]; then echo "Installing $dep"; (cd "$dep" && PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt .); fi; done # -- End of local dependencies install -- ENV LANGSERVE_GRAPHS='{{"agent": "/deps/outer-graphs/src/agent.py:graph"}}' {FORMATTED_CLEANUP_LINES}\ @@ -657,7 +657,7 @@ dependencies = ["langchain"]""" ADD . /deps/unit_tests # -- End of local package . -- # -- Installing all local dependencies -- -RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --prerelease=allow --no-cache-dir -c /api/constraints.txt -e /deps/* +RUN for dep in /deps/*; do echo "Installing $dep"; if [ -d "$dep" ]; then echo "Installing $dep"; (cd "$dep" && PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt .); fi; done # -- End of local dependencies install -- ENV LANGSERVE_GRAPHS='{"agent": "/deps/unit_tests/graphs/agent.py:graph"}' """ @@ -689,7 +689,7 @@ def test_config_to_docker_end_to_end(): ARG meow ARG foo ADD pipconfig.txt /pipconfig.txt -RUN PIP_CONFIG_FILE=/pipconfig.txt PYTHONDONTWRITEBYTECODE=1 uv pip install --system --prerelease=allow --no-cache-dir -c /api/constraints.txt langchain langchain_openai +RUN PIP_CONFIG_FILE=/pipconfig.txt PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt langchain langchain_openai # -- Adding non-package dependency graphs -- ADD ./graphs/ /deps/outer-graphs/src RUN set -ex && \\ @@ -705,7 +705,7 @@ RUN set -ex && \\ done # -- End of non-package dependency graphs -- # -- Installing all local dependencies -- -RUN PIP_CONFIG_FILE=/pipconfig.txt PYTHONDONTWRITEBYTECODE=1 uv pip install --system --prerelease=allow --no-cache-dir -c /api/constraints.txt -e /deps/* +RUN for dep in /deps/*; do echo "Installing $dep"; if [ -d "$dep" ]; then echo "Installing $dep"; (cd "$dep" && PIP_CONFIG_FILE=/pipconfig.txt PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt .); fi; done # -- End of local dependencies install -- ENV LANGSERVE_GRAPHS='{{"agent": "/deps/outer-graphs/src/agent.py:graph"}}' {FORMATTED_CLEANUP_LINES}""" @@ -811,7 +811,7 @@ RUN set -ex && \\ done # -- End of non-package dependency unit_tests -- # -- Installing all local dependencies -- -RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --prerelease=allow --no-cache-dir -c /api/constraints.txt -e /deps/* +RUN for dep in /deps/*; do echo "Installing $dep"; if [ -d "$dep" ]; then echo "Installing $dep"; (cd "$dep" && PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt .); fi; done # -- End of local dependencies install -- ENV LANGGRAPH_UI='{{"agent": "./graphs/agent.ui.jsx"}}' ENV LANGGRAPH_UI_CONFIG='{{"shared": ["nuqs"]}}' @@ -857,7 +857,7 @@ RUN set -ex && \\ done # -- End of non-package dependency unit_tests -- # -- Installing all local dependencies -- -RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --prerelease=allow --no-cache-dir -c /api/constraints.txt -e /deps/* +RUN for dep in /deps/*; do echo "Installing $dep"; if [ -d "$dep" ]; then echo "Installing $dep"; (cd "$dep" && PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt .); fi; done # -- End of local dependencies install -- ENV LANGSERVE_GRAPHS='{{"python": "/deps/outer-unit_tests/unit_tests/multiplatform/python.py:graph", "js": "/deps/outer-unit_tests/unit_tests/multiplatform/js.mts:graph"}}' # -- Installing JS dependencies -- @@ -887,7 +887,7 @@ def test_config_to_docker_pip_installer(): docker_auto, _ = config_to_docker( PATH_TO_CONFIG, config_auto, "langchain/langgraph-api:0.2.47" ) - assert "uv pip install --system --prerelease=allow" in docker_auto + assert "uv pip install --system " in docker_auto assert "rm /usr/bin/uv /usr/bin/uvx" in docker_auto # Test explicit pip setting @@ -895,7 +895,7 @@ def test_config_to_docker_pip_installer(): docker_pip, _ = config_to_docker( PATH_TO_CONFIG, config_pip, "langchain/langgraph-api:0.2.47" ) - assert "uv pip install --system --prerelease=allow" not in docker_pip + assert "uv pip install --system " not in docker_pip assert "pip install" in docker_pip assert "rm /usr/bin/uv" not in docker_pip @@ -904,7 +904,7 @@ def test_config_to_docker_pip_installer(): docker_uv, _ = config_to_docker( PATH_TO_CONFIG, config_uv, "langchain/langgraph-api:0.2.47" ) - assert "uv pip install --system --prerelease=allow" in docker_uv + assert "uv pip install --system " in docker_uv assert "rm /usr/bin/uv /usr/bin/uvx" in docker_uv # Test auto behavior with older image (should use pip) @@ -914,7 +914,7 @@ def test_config_to_docker_pip_installer(): docker_auto_old, _ = config_to_docker( PATH_TO_CONFIG, config_auto_old, "langchain/langgraph-api:0.2.46" ) - assert "uv pip install --system --prerelease=allow" not in docker_auto_old + assert "uv pip install --system " not in docker_auto_old assert "pip install" in docker_auto_old assert "rm /usr/bin/uv" not in docker_auto_old @@ -923,7 +923,7 @@ def test_config_to_docker_pip_installer(): docker_default, _ = config_to_docker( PATH_TO_CONFIG, config_default, "langchain/langgraph-api:0.2.47" ) - assert "uv pip install --system --prerelease=allow" in docker_default + assert "uv pip install --system " in docker_default def test_config_retain_build_tools(): @@ -998,7 +998,7 @@ def test_config_to_compose_simple_config(): done # -- End of non-package dependency unit_tests -- # -- Installing all local dependencies -- - RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --prerelease=allow --no-cache-dir -c /api/constraints.txt -e /deps/* + RUN for dep in /deps/*; do echo "Installing $dep"; if [ -d "$dep" ]; then echo "Installing $dep"; (cd "$dep" && PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt .); fi; done # -- End of local dependencies install -- ENV LANGSERVE_GRAPHS='{{"agent": "/deps/outer-unit_tests/unit_tests/agent.py:graph"}}' {textwrap.indent(textwrap.dedent(FORMATTED_CLEANUP_LINES), " ")} @@ -1039,7 +1039,7 @@ def test_config_to_compose_env_vars(): done # -- End of non-package dependency unit_tests -- # -- Installing all local dependencies -- - RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --prerelease=allow --no-cache-dir -c /api/constraints.txt -e /deps/* + RUN for dep in /deps/*; do echo "Installing $dep"; if [ -d "$dep" ]; then echo "Installing $dep"; (cd "$dep" && PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt .); fi; done # -- End of local dependencies install -- ENV LANGSERVE_GRAPHS='{{"agent": "/deps/outer-unit_tests/unit_tests/agent.py:graph"}}' {textwrap.indent(textwrap.dedent(FORMATTED_CLEANUP_LINES), " ")} @@ -1084,7 +1084,7 @@ def test_config_to_compose_env_file(): done # -- End of non-package dependency unit_tests -- # -- Installing all local dependencies -- - RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --prerelease=allow --no-cache-dir -c /api/constraints.txt -e /deps/* + RUN for dep in /deps/*; do echo "Installing $dep"; if [ -d "$dep" ]; then echo "Installing $dep"; (cd "$dep" && PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt .); fi; done # -- End of local dependencies install -- ENV LANGSERVE_GRAPHS='{{"agent": "/deps/outer-unit_tests/unit_tests/agent.py:graph"}}' {textwrap.indent(textwrap.dedent(FORMATTED_CLEANUP_LINES), " ")} @@ -1122,7 +1122,7 @@ def test_config_to_compose_watch(): done # -- End of non-package dependency unit_tests -- # -- Installing all local dependencies -- - RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --prerelease=allow --no-cache-dir -c /api/constraints.txt -e /deps/* + RUN for dep in /deps/*; do echo "Installing $dep"; if [ -d "$dep" ]; then echo "Installing $dep"; (cd "$dep" && PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt .); fi; done # -- End of local dependencies install -- ENV LANGSERVE_GRAPHS='{{"agent": "/deps/outer-unit_tests/unit_tests/agent.py:graph"}}' {textwrap.indent(textwrap.dedent(FORMATTED_CLEANUP_LINES), " ")} @@ -1169,7 +1169,7 @@ def test_config_to_compose_end_to_end(): done # -- End of non-package dependency unit_tests -- # -- Installing all local dependencies -- - RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --prerelease=allow --no-cache-dir -c /api/constraints.txt -e /deps/* + RUN for dep in /deps/*; do echo "Installing $dep"; if [ -d "$dep" ]; then echo "Installing $dep"; (cd "$dep" && PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt .); fi; done # -- End of local dependencies install -- ENV LANGSERVE_GRAPHS='{{"agent": "/deps/outer-unit_tests/unit_tests/agent.py:graph"}}' {textwrap.indent(textwrap.dedent(FORMATTED_CLEANUP_LINES), " ")}