Skip to content

feat(core): Remove EOL Python 3.10 support - #41267

Open
Christophe Bornet (cbornet) wants to merge 4 commits into
langchain-ai:masterfrom
cbornet:remove-py310
Open

Christophe Bornet (cbornet) wants to merge 4 commits into
langchain-ai:masterfrom
cbornet:remove-py310

Conversation

@cbornet

@cbornet Christophe Bornet (cbornet) commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator
  • Python 3.10 is EOL
  • We can modernize the code
  • We can remove code specific for 3.10
  • Remove tests on 3.10 for all modules as some depend on langchain-core

@github-actions github-actions Bot added core `langchain-core` package issues & PRs dependencies Pull requests that update a dependency file (e.g. `pyproject.toml` or `uv.lock`) size: L 500-999 LOC labels Oct 16, 2026
@langchain-oss-automated-triage langchain-oss-automated-triage Bot added trusted-contributor >= 5 merged PRs in the `langchain-ai/langchain` repo external labels Oct 16, 2026
@codspeed

codspeed Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 18.4%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

#### 🎉 Hooray! `pytest-codspeed` just leveled up to 5.0.3!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

⚡ 2 improved benchmarks
✅ 13 untouched benchmarks
⏩ 2 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ test_convert_tools_cold 193.5 ms 158.2 ms +22.28%
⚡ test_import_time[BaseChatModel] 2.1 s 1.8 s +14.65%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing cbornet:remove-py310 (d1a472a) with master (bd5b134)2

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on master (afafd55) during the generation of this report, so bd5b134 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@cbornet Christophe Bornet (cbornet) changed the title Remove EOL Python 3.10 support feat(core): Remove EOL Python 3.10 support Oct 16, 2026
@github-actions github-actions Bot added the feature For PRs that implement a new feature; NOT A FEATURE REQUEST label Oct 16, 2026
@github-actions github-actions Bot added the github_actions Pull requests that update GitHub Actions code label Oct 16, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P1] test-dependents cannot use its own matrix to define python-version.

At head f6c247de40e56d0747fead679ad1a5177fa0930c, the new python-version: ${{ matrix.python-version }} in strategy.matrix makes the Integration Tests workflow invalid. The matrix context is unavailable while GitHub evaluates strategy, so this blocks scheduled and manually dispatched runs before the jobs start. GitHub's context availability reference lists only github, needs, vars, and inputs for this location.

The compute-matrix output already contains the Python versions. This replacement passes validation and preserves the override:

python-version: ${{ fromJSON(needs.compute-matrix.outputs.matrix).python-version }}

I ran actionlint 1.7.12 with -shellcheck= -pyflakes= on the complete workflow: the PR base (c088db971097f0f12c7b8c30d473e8dbde09c823) and current master (b7b942a7ffd3206e1b572f4d0639377bca4750d7) pass; this head fails with context "matrix" is not allowed here; a temporary copy with the replacement passes. I also executed the head's matrix-generation shell step offline: it emits ["3.11", "3.14"] by default and ["3.12"] with that override.

This review is scoped to the integration workflow change.

@socket-security

socket-security Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednumpy@​2.5.47110010010070
Addedresponses@​0.26.399100100100100
Addedjsonpatch@​1.35100100100100100
Addedpydantic@​2.14.1100100100100100
Addedruff@​0.16.10100100100100100
Addedpytest-recording@​0.14.0100100100100100
Addedblockbuster@​1.5.29100100100100100
Addedpytest-mock@​3.17.0100100100100100
Addedtenacity@​9.2.1100100100100100
Addedtypes-requests@​2.33.0.20261006100100100100100

View full report

@cbornet

Copy link
Copy Markdown
Collaborator Author

Fixed integration test.

py_versions = ["3.11", "3.12", "3.13", "3.14"]
else:
py_versions = ["3.10", "3.14"]
py_versions = ["3.11", "3.14"]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Most libs depend on core so we can't test them in 3.10 anymore.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core `langchain-core` package issues & PRs dependencies Pull requests that update a dependency file (e.g. `pyproject.toml` or `uv.lock`) external feature For PRs that implement a new feature; NOT A FEATURE REQUEST github_actions Pull requests that update GitHub Actions code size: L 500-999 LOC trusted-contributor >= 5 merged PRs in the `langchain-ai/langchain` repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ Proxy