From 8f3bfa8c23e9e25afa51903deec63c21053fe8b9 Mon Sep 17 00:00:00 2001 From: Anatolii Date: Thu, 18 Jun 2026 13:07:56 +0400 Subject: [PATCH] fix(ci): add langchain-core to [dev] so test collection passes The SDK's import chain (nullrun.__init__ -> nullrun.decorators -> nullrun.instrumentation.langgraph -> 'from langchain_core.callbacks import BaseCallbackHandler') runs at pytest *collection* time, not at a specific test. With CI installing [dev] only, every test in the suite errored on collection with: ModuleNotFoundError: No module named 'langchain_core' This is the same class of bug that 'nullrun[langgraph]' exists to prevent for end users, except the dev install never benefited from the extras indirection. Fix: add 'langchain-core>=0.3,<1.0' to the [dev] extras. The heavier 'langgraph' / 'langchain' extras pull in stacks the unit tests don't use; the bare core is the smallest dep that makes the import chain resolve and unblocks test collection on every supported Python (3.10 / 3.11 / 3.12) on every PR. Validation: locally on Python 3.14.2 (which is outside the 3.10/3.11/3.12 matrix that CI tests), 'pip install -e .[dev]' followed by 'pytest tests/' runs 443/443 + 9/9 new byte-mismatch unit tests, no collection error. CI will re-confirm on the 3.10 / 3.11 / 3.12 matrix. --- pyproject.toml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 6091d81..646a407 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,6 +76,16 @@ dev = [ "coverage[toml]>=7.0", "grpcio-tools>=1.60.0,<2.0", "httpx>=0.27.0,<1.0", + # The SDK eagerly imports `nullrun.instrumentation.langgraph` + # (from `nullrun.decorators`, imported by `nullrun.__init__` at + # collection time), which itself does `from langchain_core.callbacks + # import BaseCallbackHandler`. Without this dep, *every* test in + # the suite errors at pytest collection, not at a specific test. + # CI installs `[dev]` only, so the test extras need to cover the + # import chain. `langchain-core` is the smallest dep that makes + # the import succeed; the `langgraph` and `langchain` extras pull + # in heavier stacks that the unit tests don't need. + "langchain-core>=0.3,<1.0", ] [project.urls]