diff --git a/libs/cli/langgraph_cli/config.py b/libs/cli/langgraph_cli/config.py index f90ed3a12..cdbf6ee8e 100644 --- a/libs/cli/langgraph_cli/config.py +++ b/libs/cli/langgraph_cli/config.py @@ -223,13 +223,15 @@ def config_to_docker(config_path: pathlib.Path, config: Config, base_image: str) # https://til.simonwillison.net/python/pyproject faux_pkgs_str = f"{os.linesep}{os.linesep}".join( f"""ADD {relpath} {destpath} -COPY <> /deps/__outer_{fullpath.name}/pyproject.toml; \\ + done +""" for fullpath, (relpath, destpath) in local_deps.faux_pkgs.items() ) local_pkgs_str = os.linesep.join( diff --git a/libs/cli/tests/unit_tests/test_config.py b/libs/cli/tests/unit_tests/test_config.py index c47b36e7b..f50eee96c 100644 --- a/libs/cli/tests/unit_tests/test_config.py +++ b/libs/cli/tests/unit_tests/test_config.py @@ -73,13 +73,14 @@ def test_config_to_docker_simple(): expected_docker_stdin = """\ FROM langchain/langgraph-api:3.11 ADD . /deps/__outer_unit_tests/unit_tests -COPY <> /deps/__outer_unit_tests/pyproject.toml; \\ + done RUN pip install -c /api/constraints.txt -e /deps/* ENV LANGSERVE_GRAPHS='{"agent": "/deps/__outer_unit_tests/unit_tests/agent.py:graph"}' WORKDIR /deps/__outer_unit_tests/unit_tests\ @@ -104,13 +105,14 @@ def test_config_to_docker_pipconfig(): FROM langchain/langgraph-api:3.11 ADD pipconfig.txt /pipconfig.txt ADD . /deps/__outer_unit_tests/unit_tests -COPY <> /deps/__outer_unit_tests/pyproject.toml; \\ + done RUN PIP_CONFIG_FILE=/pipconfig.txt pip install -c /api/constraints.txt -e /deps/* ENV LANGSERVE_GRAPHS='{"agent": "/deps/__outer_unit_tests/unit_tests/agent.py:graph"}' WORKDIR /deps/__outer_unit_tests/unit_tests\ @@ -153,13 +155,14 @@ def test_config_to_docker_local_deps(): expected_docker_stdin = """\ FROM langchain/langgraph-api-custom:3.11 ADD ./graphs /deps/__outer_graphs/src -COPY <> /deps/__outer_graphs/pyproject.toml; \\ + done RUN pip install -c /api/constraints.txt -e /deps/* ENV LANGSERVE_GRAPHS='{"agent": "/deps/__outer_graphs/src/agent.py:graph"}'\ """ @@ -216,13 +219,14 @@ ARG foo ADD pipconfig.txt /pipconfig.txt RUN PIP_CONFIG_FILE=/pipconfig.txt pip install -c /api/constraints.txt langchain langchain_openai ADD ./graphs/ /deps/__outer_graphs/src -COPY <> /deps/__outer_graphs/pyproject.toml; \\ + done RUN PIP_CONFIG_FILE=/pipconfig.txt pip install -c /api/constraints.txt -e /deps/* ENV LANGSERVE_GRAPHS='{"agent": "/deps/__outer_graphs/src/agent.py:graph"}'""" assert clean_empty_lines(actual_docker_stdin) == expected_docker_stdin @@ -239,13 +243,14 @@ def test_config_to_compose_simple_config(): dockerfile_inline: | FROM langchain/langgraph-api:3.11 ADD . /deps/__outer_unit_tests/unit_tests - COPY <> /deps/__outer_unit_tests/pyproject.toml; \\ + done RUN pip install -c /api/constraints.txt -e /deps/* ENV LANGSERVE_GRAPHS='{"agent": "/deps/__outer_unit_tests/unit_tests/agent.py:graph"}' WORKDIR /deps/__outer_unit_tests/unit_tests @@ -268,13 +273,14 @@ def test_config_to_compose_env_vars(): dockerfile_inline: | FROM langchain/langgraph-api-custom:3.11 ADD . /deps/__outer_unit_tests/unit_tests - COPY <> /deps/__outer_unit_tests/pyproject.toml; \\ + done RUN pip install -c /api/constraints.txt -e /deps/* ENV LANGSERVE_GRAPHS='{"agent": "/deps/__outer_unit_tests/unit_tests/agent.py:graph"}' WORKDIR /deps/__outer_unit_tests/unit_tests @@ -304,13 +310,14 @@ def test_config_to_compose_env_file(): dockerfile_inline: | FROM langchain/langgraph-api:3.11 ADD . /deps/__outer_unit_tests/unit_tests - COPY <> /deps/__outer_unit_tests/pyproject.toml; \\ + done RUN pip install -c /api/constraints.txt -e /deps/* ENV LANGSERVE_GRAPHS='{"agent": "/deps/__outer_unit_tests/unit_tests/agent.py:graph"}' WORKDIR /deps/__outer_unit_tests/unit_tests @@ -333,13 +340,14 @@ def test_config_to_compose_watch(): dockerfile_inline: | FROM langchain/langgraph-api:3.11 ADD . /deps/__outer_unit_tests/unit_tests - COPY <> /deps/__outer_unit_tests/pyproject.toml; \\ + done RUN pip install -c /api/constraints.txt -e /deps/* ENV LANGSERVE_GRAPHS='{"agent": "/deps/__outer_unit_tests/unit_tests/agent.py:graph"}' WORKDIR /deps/__outer_unit_tests/unit_tests @@ -375,13 +383,14 @@ def test_config_to_compose_end_to_end(): dockerfile_inline: | FROM langchain/langgraph-api:3.11 ADD . /deps/__outer_unit_tests/unit_tests - COPY <> /deps/__outer_unit_tests/pyproject.toml; \\ + done RUN pip install -c /api/constraints.txt -e /deps/* ENV LANGSERVE_GRAPHS='{"agent": "/deps/__outer_unit_tests/unit_tests/agent.py:graph"}' WORKDIR /deps/__outer_unit_tests/unit_tests