mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-12 20:57:52 +02:00
run pip check before edittable install
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user