Skip to content

Drop Python 3.10 and add Python 3.15 support - #992

Merged
lmolkova merged 8 commits into
open-telemetry:mainfrom
samtin0x:drop-py310-add-py315
Oct 28, 2026
Merged

lmolkova merged 8 commits into
open-telemetry:mainfrom
samtin0x:drop-py310-add-py315

Conversation

@samtin0x

@samtin0x samtin0x commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #973

All packages now require Python 3.11+. I removed the 3.10 classifiers and added 3.15 ones. The -oldest envs run on 3.11 and the -latest envs on 3.11 and 3.15, so CI stays at 65 jobs. Conformance stays on 3.14.

Known gaps:

  • CrewAI stays on 3.14 and gets no 3.15 classifier. It caps pydantic below 2.13, and those pydantic-core releases have no 3.15 wheels.
  • claude-agent-sdk and qwen-agent don't list 3.14 in their classifiers, so I left 3.15 off too. Their tests pass on 3.15. qwenpaw is unchanged.
  • The openai tests pinned pydantic==2.12.5 for PyPy 3.10, which blocked 3.15. It's 2.14.1 now and the Renovate rule for it is gone.
  • Ruff now targets 3.11, which rewrote a few imports (typing.Self, datetime.UTC).
  • A from-scratch uv lock already fails on main (qwenpaw and onnxruntime at 3.14), so I updated the existing lock. Only 3.10 entries were dropped.

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

  • uv run tox -e precommit, typecheck, check-util-api
  • Every py311 and py315 test env, plus crewai-latest on py314

anthropic-latest fails 13 beta tests with anthropic 2.3.0 on every Python version. It fails the same way on main. With anthropic 2.2.0 all 385 pass on 3.15.

Checklist

See CONTRIBUTING.md
for the style guide, changelog guidance, and more.

  • Followed the style guidelines of this project
  • Changelog updated if the change requires an entry
  • Unit tests added
  • Documentation updated

Every package now requires Python 3.11+. The -oldest envs move to 3.11
and the -latest envs to 3.11 and 3.15. CrewAI stays on 3.14 because it
caps pydantic below 2.13, which has no 3.15 wheels.

The openai test pydantic pin only existed for PyPy 3.10 and blocked 3.15,
so it moves to 2.14.1 along with its Renovate rule.
Ruff picks up the new requires-python, so typing_extensions.Self becomes
typing.Self, timezone.utc becomes UTC, and a 3.10-only branch in a
langchain test helper goes away.
@samtin0x
samtin0x requested a review from a team as a code owner October 26, 2026 22:12
Copilot AI balanced review requested due to automatic review settings October 26, 2026 22:12
@linux-foundation-easycla

linux-foundation-easycla Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-10-28 18:02 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The compatibility changes align with the intended Python support policy and documented exceptions, with no identified blocking issues.

No open issues 🎉

What changed in this PR

Raises the monorepo’s minimum Python version to 3.11 and adds Python 3.15 coverage, addressing #973’s dependency-maintenance concerns after Python 3.10 reaches end of life.

Changes:

  • Updates package and example metadata, retaining documented compatibility exceptions.
  • Moves oldest test environments to 3.11 and most latest environments to 3.11/3.15 without increasing the matrix size.
  • Removes obsolete compatibility branches and dependency constraints, and aligns contributor guidance.
File Description
util/​opentelemetry-util-genai/​tests/​test_utils.py Uses standard-library datetime.UTC.
util/​opentelemetry-util-genai/​src/​opentelemetry/​util/​genai/​_invocation.py Imports Self from typing.
util/​opentelemetry-util-genai/​pyproject.toml Requires 3.11+ and declares 3.15 support.
util/​opentelemetry-test-util-genai/​pyproject.toml Raises test utilities’ minimum to 3.11.
tox.ini Updates interpreter coverage while retaining compatibility exceptions.
pyproject.toml Raises workspace and type-checking baselines to 3.11.
instrumentation/​opentelemetry-instrumentation-google-genai/​pyproject.toml Updates Python metadata and local type-checking baseline.
instrumentation/​opentelemetry-instrumentation-genai-weaviate-client/​pyproject.toml Requires 3.11+ and declares 3.15 support.
instrumentation/​opentelemetry-instrumentation-genai-smolagents/​pyproject.toml Requires 3.11+ and declares 3.15 support.
instrumentation/​opentelemetry-instrumentation-genai-qwenpaw/​pyproject.toml Drops 3.10 support, retaining the existing upper classifier.
instrumentation/​opentelemetry-instrumentation-genai-qwen-agent/​tests/​requirements.latest.txt Updates the comment explaining unpinned NumPy.
instrumentation/​opentelemetry-instrumentation-genai-qwen-agent/​pyproject.toml Drops 3.10 support without adding newer classifiers.
instrumentation/​opentelemetry-instrumentation-genai-portkey/​pyproject.toml Requires 3.11+ and declares 3.15 support.
instrumentation/​opentelemetry-instrumentation-genai-openai/​tests/​test_response_extractors.py Uses datetime.UTC in test data.
instrumentation/​opentelemetry-instrumentation-genai-openai/​tests/​requirements.v2.txt Updates Pydantic for Python 3.15 compatibility.
instrumentation/​opentelemetry-instrumentation-genai-openai/​tests/​requirements.v1.txt Updates Pydantic for Python 3.15 compatibility.
instrumentation/​opentelemetry-instrumentation-genai-openai/​tests/​requirements.oldest.txt Removes the Python 3.10 NumPy pin.
instrumentation/​opentelemetry-instrumentation-genai-openai/​tests/​requirements.latest.txt Updates Pydantic and removes conditional HTTPX2 pins.
instrumentation/​opentelemetry-instrumentation-genai-openai/​pyproject.toml Requires 3.11+ and declares 3.15 support.
instrumentation/​opentelemetry-instrumentation-genai-openai-agents/​pyproject.toml Requires 3.11+ and declares 3.15 support.
instrumentation/​opentelemetry-instrumentation-genai-llama-index/​pyproject.toml Requires 3.11+ and declares 3.15 support.
instrumentation/​opentelemetry-instrumentation-genai-langchain/​tests/​test_operation_mapping.py Imports standard-library Self.
instrumentation/​opentelemetry-instrumentation-genai-langchain/​tests/​test_execution_context.py Removes Python 3.10 cancellation handling from assertions.
instrumentation/​opentelemetry-instrumentation-genai-langchain/​tests/​test_agent_classification_corpus.py Imports standard-library Self.
instrumentation/​opentelemetry-instrumentation-genai-langchain/​pyproject.toml Requires 3.11+ and declares 3.15 support.
instrumentation/​opentelemetry-instrumentation-genai-langchain/​examples/​zero-code/​pyproject.toml Raises the example minimum to 3.11.
instrumentation/​opentelemetry-instrumentation-genai-langchain/​examples/​manual/​uv.lock Removes Python 3.10 resolution branches and artifacts.
instrumentation/​opentelemetry-instrumentation-genai-langchain/​examples/​manual/​pyproject.toml Raises the example minimum to 3.11.
instrumentation/​opentelemetry-instrumentation-genai-dspy/​pyproject.toml Requires 3.11+ and declares 3.15 support.
instrumentation/​opentelemetry-instrumentation-genai-crewai/​pyproject.toml Drops 3.10 support without declaring 3.15 support.
instrumentation/​opentelemetry-instrumentation-genai-claude-agent-sdk/​pyproject.toml Drops 3.10 support without adding newer classifiers.
instrumentation/​opentelemetry-instrumentation-genai-bedrock/​pyproject.toml Requires 3.11+ and declares 3.15 support.
instrumentation/​opentelemetry-instrumentation-genai-anthropic/​pyproject.toml Requires 3.11+ and declares 3.15 support.
instrumentation/​opentelemetry-instrumentation-genai-agno/​pyproject.toml Requires 3.11+ and declares 3.15 support.
examples/​suppress-inference-event/​manual/​pyproject.toml Raises the example minimum to 3.11.
examples/​suppress-inference-event/​declarative/​pyproject.toml Raises the example minimum to 3.11.
AGENTS.md Updates documented test-matrix templates.
.github/​renovate.json5 Removes the obsolete Pydantic update restriction.
.github/​instructions/​build-config.instructions.md Aligns matrix review guidance with the new versions.

Review effort: Balanced

@samtin0x

Copy link
Copy Markdown
Contributor Author

The anthropic failures are the anthropic 2.3.0 breakage that #991 fixes; nothing here touches it. I'll update the branch once #991 lands.

Comment thread tox.ini Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This can be removed.. ruffs up rule misses some stuff.

Other things that can be removed:

scripts/check_deps.py (lines 42–45):

diff
-try:

  • import tomllib
    -except ModuleNotFoundError: # Python < 3.11
  • import tomli as tomllib
    +import tomllib

scripts/version_utils.py (lines 14–17):

diff
-try:

  • import tomllib
    -except ModuleNotFoundError:
  • import tomli as tomllib
    +import tomllib
  1. Dead sys.version_info < (3, 11) Test Skip Markers in langchain

  2. Stale pypy-3.10 Mapping and Comments

scripts/tox_matrix.py (lines 25, 30–31):
_PY_FACTOR_VERSION: dict[str, str] = {"pypy3": "pypy-3.10"} is dead code pointing to Python 3.10

  1. random stuff

enum.StrEnum (Python 3.11+): Modality(str, Enum) (which manually defines def str(self) -> str: return self.value to work around Python 3.11's str(Enum) format change) and Role(str, Enum) in util/opentelemetry-util-genai/src/opentelemetry/util/genai/types.py (lines 162, 332) can use enum.StrEnum (verify against tox -e check-util-api / griffe first in case base-class change is flagged).

Branch Protection Rules: if repository branch protection rules list specific 3.10 or 3.14 matrix job names as required status checks, they will need to be updated to the 3.11 / 3.15 job names (not sure if we do this)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in b769550, and merged main. I left StrEnum out because check-util-api flags it; happy to do it in a separate PR.

Comment thread tox.ini Outdated
; instrumentation-genai-crewai
py3{10,14}-test-instrumentation-genai-crewai-latest
py310-test-instrumentation-genai-crewai-oldest
; crewai caps pydantic below 2.13, which has no Python 3.15 wheels.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: crewai also pulls in onnxruntime (via chromadb), which has no cp315 wheels yet (microsoft/onnxruntime#33359). Naming both blockers makes it easier to tell when 3.15 can be enabled.

Suggested change
; crewai caps pydantic below 2.13, which has no Python 3.15 wheels.
; crewai caps pydantic below 2.13 and pulls in onnxruntime (via chromadb); neither has Python 3.15 wheels.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in a6ad763.

Comment thread tox.ini Resolved
…5-v2

# Conflicts:
#	util/opentelemetry-util-genai/src/opentelemetry/util/genai/_invocation.py
@samtin0x

Copy link
Copy Markdown
Contributor Author

Merged main and applied the tox.ini suggestions. Could someone approve the workflow run?

@lmolkova
lmolkova enabled auto-merge October 28, 2026 17:16
@lmolkova
lmolkova added this pull request to the merge queue Oct 28, 2026
Merged via the queue into open-telemetry:main with commit 235437c Oct 28, 2026
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Drop Python 3.10 support

4 participants