-
Type:
Task
-
Resolution: Done
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: ABX
-
None
-
None
-
Python Drivers
-
None
-
None
-
None
-
None
-
None
-
None
Summary:
numpy has no cp314 wheel, and langchain-core floor breaks the minimum-version test suite.
Goal
Raise two dependency floors in libs/langchain-mongodb/pyproject.toml so that (a) the package installs on Python 3.14 and (b) its unit suite passes at declared minimum versions.
Blocked by
Nothing. Should land before the CI minimum-version fix (linked), which will otherwise turn these into red CI.
Issue 1 — numpy floor has no Python 3.14 wheel
Declared: "numpy>=1.26"
On Python 3.14, uv sync --resolution=lowest-direct selects numpy==2.1.0, which ships no cp314 wheel. uv falls back to a source build, which fails to compile:
× Failed to build `numpy==2.1.0` ../numpy/_core/src/umath/string_fastsearch.h:132:5: error: no type named ... ../numpy/_core/src/umath/string_fastsearch.h:219:23: error: invalid ...
First numpy release shipping cp314 wheels: 2.3.2 (verified against the PyPI file list).
This is the same class of failure as the pydantic/pydantic-core PyO3 issue already fixed under INTPYTHON-1054 — a native-extension floor that predates Python 3.14 support.
Necessary but not sufficient. Fixing numpy alone uncovers a second 3.14 build failure immediately underneath it:
× Failed to build `pydantic-core==2.33.2`
hint: `pydantic-core` (v2.33.2) was included because `langchain-mongodb` (v0.11.0)
depends on `langchain-classic` (v1.0.0) which depends on `pydantic` (v2.11.10)
That one is fixed by the pydantic>=2.13.0 floor added under INTPYTHON-1054. Verified: numpy fix + that pydantic floor together make uv sync --resolution=lowest-direct --python=3.14 succeed (106 packages, no build step). Both changes must be on main before langchain-mongodb can claim Python 3.14 support.
Issue 2 — langchain-core floor breaks minimum-version tests
Declared: "langchain-core>=1.2.5"
At minimum versions on Python 3.11, 12 tests in tests/unit_tests/test_cache.py fail:
AttributeError: 'FakeLLM' object has no attribute 'asdict'
tests/unit_tests/test_cache.py calls llm.asdict() at lines 103 and 212. That method does not exist in langchain-core 1.4.1 or earlier; it was introduced in 1.4.2 (bisected by installing each release and checking hasattr).
Verified: with langchain-core==1.4.2 and all other direct deps at their floors, the full unit suite passes — 75 passed.
Note this failure is currently invisible because the CI step that would catch it is a no-op (see linked ticket).
Proposed change
| Dependency | Current | Proposed | Reason |
|---|---|---|---|
| numpy | >=1.26 | >=2.3.2 | first cp314 wheel |
| langchain-core | >=1.2.5 | >=1.4.2 | asdict() used by test suite |
Decisions taken (open to review)
- numpy: environment markers rather than an unconditional bump. Raising the floor to 2.3.2 for every interpreter would force users on 3.11–3.13 onto numpy 2.3+, where >=1.26 remains perfectly valid and some users are deliberately pinned to numpy 1.x. Implemented as:
"numpy>=1.26; python_version < '3.14'", "numpy>=2.3.2; python_version >= '3.14'",
- langchain-core: dev-group floor only, runtime floor left at >=1.2.5. The break is in test code (test_cache.py calls llm.asdict()), not in langchain_mongodb/. Raising the runtime floor would narrow the supported range for users with no evidence the library needs it. Residual gap worth noting: with the dev floor at 1.4.2, the minimum-version job resolves langchain-core to 1.4.2, so the declared runtime floor of 1.2.5 is still never exercised. Confirming whether 1.2.5 genuinely works is a separate question.
Acceptance criteria
- uv sync --resolution=lowest-direct --python=3.14 succeeds in libs/langchain-mongodb.
- uv run --no-sync pytest tests/unit_tests passes against a lowest-direct environment on the supported Python matrix.
- No regression in the existing suite at highest versions.
Verification basis
All results reproduced locally in a clean git worktree at main, Python 3.11 and 3.14, using uv sync -resolution=lowest-direct followed by uv run --no-sync pytest (the -no-sync being necessary precisely because of the linked CI no-op bug).