Skip to content

Revisit langchain-core version pin once upstream drops Pydantic v1 on Python 3.14+ #16

@justin-layerv

Description

@justin-layerv

Context

layerv-qurl[langchain] depends on langchain-core>=0.3,<2. On Python 3.14+, langchain-core emits a UserWarning at module-load time:

UserWarning: Core Pydantic V1 functionality isn't compatible with Python 3.14 or greater.
  from pydantic.v1.fields import FieldInfo as FieldInfoV1

Source: langchain_core/_api/deprecation.py:25 (imports pydantic.v1.fields unconditionally).

Current state

  • CI matrix runs on Python 3.10 / 3.12 / 3.13 — the warning does not fire in CI, all three legs are green.
  • Warning only surfaces on local dev machines running Python 3.14+ that install the [langchain] or [dev] extra.
  • PR feat!: align types and client with latest API spec #8 briefly added a pyproject.toml filterwarnings entry to silence it globally, but that was reverted (commit 339c918) because it would hide a real forward-compat signal from every contributor and consumer running the test suite.

Fix options

  1. Bump langchain-core>=X in [project.optional-dependencies].langchain once upstream releases a version that drops pydantic.v1 imports (or gates them behind a runtime check). This is the cleanest fix once upstream ships it.
  2. Add Python 3.14 to the CI matrix once the upstream fix lands, to prevent regression.
  3. File upstream issue at langchain-ai/langchain and link it from this issue so we can track when it's resolved.

Action items

  • Check langchain-core release notes for any version that addresses this (as of 2026-04-11 the >=0.3,<2 constraint still pulls a broken-on-3.14 version in my local install).
  • Once a fix version exists, bump the [langchain] extra constraint to langchain-core>=X,<2.
  • Add Python 3.14 to the test matrix in .github/workflows/ci.yml once the fix lands.
  • If no upstream fix exists after a reasonable window, file langchain-ai/langchain issue and link from here.

Why this issue exists

Documenting the deliberate decision to not silence the warning via pyproject.toml so a future maintainer doesn't wonder why it's visible. The warning is a signal, not noise — local contributors on 3.14 seeing it is the intended outcome until we have a real fix.

Referenced from PR #8 comment: #8 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency fileenhancementNew feature or requestpriority: lowNice-to-have improvements

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions