Skip to content

build: make langgraph-cli[inmem] an optional dependency - #354

Open
weed33834 wants to merge 2 commits into
NVIDIA:mainfrom
weed33834:fix/langgraph-cli-optional-343
Open

build: make langgraph-cli[inmem] an optional dependency#354
weed33834 wants to merge 2 commits into
NVIDIA:mainfrom
weed33834:fix/langgraph-cli-optional-343

Conversation

@weed33834

Copy link
Copy Markdown

Summary

Fixes #343.

langgraph-cli[inmem] was declared as a hard runtime dependency in [project.dependencies], but nothing under src/skillspector/ imports it. Its only consumers in the repo are the make langgraph-dev target and langgraph.json — both developer tooling for LangGraph Studio.

Because it is a runtime dependency, every install of the skillspector CLI — including ones that never run the dev server — pulls in the full LangGraph API server stack:

  • langgraph-api + langgraph-runtime-inmem
  • grpcio, grpcio-tools, grpcio-health-checking
  • opentelemetry-api, opentelemetry-sdk, opentelemetry-exporter-otlp-proto-http, opentelemetry-exporter-prometheus
  • uvicorn, starlette, sse-starlette, structlog, cloudpickle, croniter, watchfiles

Changes

  1. pyproject.toml: Move langgraph-cli[inmem]>=0.4.14 from [project.dependencies] to a new [project.optional-dependencies] langgraph-dev extra.
  2. pyproject.toml: Add skillspector[langgraph-dev] to the existing dev extra so make install-dev (uv sync --all-extras / pip install -e ".[dev]") is unaffected.
  3. Makefile: The langgraph-dev target now checks for the langgraph command and prints a helpful install hint (pip install 'skillspector[langgraph-dev]') if it is missing.

Verification

  • langgraph (the graph library) remains a hard dependency — src/skillspector/graph.py imports from langgraph.graph import END, START, StateGraph.
  • Confirmed no src/skillspector/ code imports langgraph_cli or langgraph.cli.
  • pyproject.toml parses correctly (validated with tomllib).
  • CI workflows and Dockerfile do not reference langgraph-cli directly.
  • make install-dev still installs langgraph-cli via the devlanggraph-dev extra chain.

期待多多合作,互相帮助。

Comment thread pyproject.toml
"mcp>=1.2.0",
]
langgraph-dev = [
"langgraph-cli[inmem]>=0.4.14",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: this dependency-graph change does not update uv.lock. On the exact head, uv lock --check resolves successfully and then reports that the lockfile needs to be updated. The release workflow uses uv sync --locked --extra dev, so the committed state cannot pass that install step. Regenerate and commit uv.lock, then verify a plain install omits langgraph-cli while the dev extra retains it.

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Automated SkillSpector Review]

Requesting changes. Moving the dependency to an extra is sound, and the Make target remains valid, but the committed lockfile was not regenerated. Exact-head uv lock --check reports that uv.lock needs an update; the release workflow uses uv sync --locked --extra dev, so the current patch breaks that installation path. Commit the updated lock and verify plain versus dev installs.

langgraph-cli[inmem] was declared as a hard runtime dependency, but
nothing under src/skillspector/ imports it. Its only consumers are the
`make langgraph-dev` target and langgraph.json — both developer tooling
for LangGraph Studio.

Because it is a runtime dependency, every install of the skillspector
CLI — including ones that never run the dev server — pulls in the full
LangGraph API server stack (grpcio, opentelemetry-*, uvicorn, starlette,
sse-starlette, structlog, cloudpickle, croniter, watchfiles, ...).

Move it to a new `langgraph-dev` optional extra so a plain
`pip install skillspector` stays lightweight. The `dev` extra pulls it
in transitively via `skillspector[langgraph-dev]` so `make install-dev`
is unaffected. The `langgraph-dev` Makefile target now prints a helpful
install hint if the `langgraph` command is missing.

Fixes NVIDIA#343
@weed33834
weed33834 force-pushed the fix/langgraph-cli-optional-343 branch from fb1fcfd to 5315b84 Compare August 11, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can langgraph-cli[inmem] be an optional dependency?

2 participants