run pip check before edittable install

This commit is contained in:
Josh Rogers
2026-05-27 16:31:55 -04:00
parent c39a3a7c87
commit 790a4a1a10
2 changed files with 18 additions and 14 deletions
+8 -10
View File
@@ -66,16 +66,7 @@ def _get_pip_cleanup_lines(
to_uninstall: tuple[str] | None,
pip_installer: Literal["uv", "pip"],
) -> str:
commands = [
(
"# -- Ensure user deps didn't inadvertently overwrite langgraph-api\n"
"RUN mkdir -p /api/langgraph_api /api/langgraph_runtime /api/langgraph_license && \\\n"
"touch /api/langgraph_api/__init__.py /api/langgraph_runtime/__init__.py /api/langgraph_license/__init__.py\n"
f"RUN PYTHONDONTWRITEBYTECODE=1 {install_cmd} --no-cache-dir --no-deps -e /api\n"
"# -- End of ensuring user deps didn't inadvertently overwrite langgraph-api --\n"
"# -- Validate installed dependencies are internally consistent --"
)
]
commands = ["# -- Validate installed dependencies are internally consistent --"]
if pip_installer == "uv":
commands.append(
"""RUN uv pip check --system || ( \
@@ -94,6 +85,13 @@ exit 1 \
)
commands.append(
"""# -- End dependency validation --
# -- Ensure user deps didn't inadvertently overwrite langgraph-api
RUN mkdir -p /api/langgraph_api /api/langgraph_runtime /api/langgraph_license && \
touch /api/langgraph_api/__init__.py /api/langgraph_runtime/__init__.py /api/langgraph_license/__init__.py
RUN PYTHONDONTWRITEBYTECODE=1 """
+ install_cmd
+ """ --no-cache-dir --no-deps -e /api
# -- End of ensuring user deps didn't inadvertently overwrite langgraph-api --
# -- Removing build deps from the final image ~<:===~~~ --"""
)
if to_uninstall: