Skip to content

Enforce bounds on instruments dependencies and pin latest test requirements - #438

Open
lmolkova wants to merge 5 commits into
open-telemetry:mainfrom
lmolkova:check-instruments-bounds
Open

Enforce bounds on instruments dependencies and pin latest test requirements#438
lmolkova wants to merge 5 commits into
open-telemetry:mainfrom
lmolkova:check-instruments-bounds

Conversation

@lmolkova

@lmolkova lmolkova commented Aug 21, 2026

Copy link
Copy Markdown
Member

Enforces that all [project.optional-dependencies] instruments and package.py _instruments declare both lower and upper bounds, and that target libraries in tests/requirements.latest.txt are pinned/upper-bounded (~= major.minor or == major.minor.patch).

Target libraries frequently introduce breaking changes in major releases (as seen in #393 for OpenAI and #435 for Anthropic). Unbounded dependencies cause unexpected CI failures across the repo when *-latest matrix environments install newly released major versions.

@lmolkova

lmolkova commented Aug 21, 2026

Copy link
Copy Markdown
Member Author

Blocked on #435

No longer blocked, they can be merged in any order

@lmolkova lmolkova changed the title Enforce lower and upper bounds on instruments dependencies [DO NOT MERGE] Enforce lower and upper bounds on instruments dependencies Aug 21, 2026
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Aug 21, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-08-21 05:20 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • 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.

Pull request overview

This PR tightens dependency hygiene for instrumentation packages by requiring all instruments extra requirements (and the corresponding package.py _instruments) to declare both lower and upper bounds, and updates packages/docs/lockfile accordingly to avoid CI breakage when upstream libraries ship new major versions.

Changes:

  • Update scripts/check_deps.py to enforce presence of both lower and upper bounds for instruments extra requirements (in addition to matching _instruments).
  • Add missing upper bounds to multiple instrumentation packages’ pyproject.toml instruments extras and package.py _instruments, updating related tests.
  • Refresh uv.lock and update the top-level README instrumentation support table to reflect the bounded ranges.

Reviewed changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
uv.lock Regenerated lockfile reflecting newly bounded instrument dependencies.
scripts/check_deps.py Enforces lower+upper bounds on instruments requirements (and keeps _instruments in sync).
README.md Updates “Supported Package” version ranges to include upper bounds.
instrumentation/opentelemetry-instrumentation-genai-smolagents/tests/test_instrumentor.py Adjusts expected dependency string to include an upper bound.
instrumentation/opentelemetry-instrumentation-genai-smolagents/src/opentelemetry/instrumentation/genai/smolagents/package.py Adds upper bound to _instruments.
instrumentation/opentelemetry-instrumentation-genai-smolagents/pyproject.toml Adds upper bound to instruments extra.
instrumentation/opentelemetry-instrumentation-genai-qwen-agent/tests/test_instrumentor.py Adjusts expected dependency string to include an upper bound.
instrumentation/opentelemetry-instrumentation-genai-qwen-agent/src/opentelemetry/instrumentation/genai/qwen_agent/package.py Adds upper bound to _instruments.
instrumentation/opentelemetry-instrumentation-genai-qwen-agent/pyproject.toml Adds upper bound to instruments extra.
instrumentation/opentelemetry-instrumentation-genai-openai-agents/src/opentelemetry/instrumentation/genai/openai_agents/package.py Adds upper bound to _instruments.
instrumentation/opentelemetry-instrumentation-genai-openai-agents/pyproject.toml Adds upper bound to instruments extra.
instrumentation/opentelemetry-instrumentation-genai-llama-index/src/opentelemetry/instrumentation/genai/llama_index/package.py Adds upper bound to _instruments.
instrumentation/opentelemetry-instrumentation-genai-llama-index/pyproject.toml Adds upper bound to instruments extra.
instrumentation/opentelemetry-instrumentation-genai-langchain/src/opentelemetry/instrumentation/genai/langchain/package.py Adds upper bound to _instruments.
instrumentation/opentelemetry-instrumentation-genai-langchain/pyproject.toml Adds upper bound to instruments extra.
instrumentation/opentelemetry-instrumentation-genai-crewai/tests/test_instrumentor.py Adjusts expected dependency string to include an upper bound.
instrumentation/opentelemetry-instrumentation-genai-crewai/src/opentelemetry/instrumentation/genai/crewai/package.py Adds upper bound to _instruments.
instrumentation/opentelemetry-instrumentation-genai-crewai/pyproject.toml Adds upper bound to instruments extra.
instrumentation/opentelemetry-instrumentation-genai-claude-agent-sdk/tests/test_instrumentor.py Adjusts expected dependency string to include an upper bound.
instrumentation/opentelemetry-instrumentation-genai-claude-agent-sdk/src/opentelemetry/instrumentation/genai/claude_agent_sdk/package.py Adds upper bound to _instruments.
instrumentation/opentelemetry-instrumentation-genai-claude-agent-sdk/pyproject.toml Adds upper bound to instruments extra.
instrumentation/opentelemetry-instrumentation-genai-anthropic/tests/test_instrumentor.py Adjusts expected dependency string to include an upper bound.
instrumentation/opentelemetry-instrumentation-genai-anthropic/src/opentelemetry/instrumentation/genai/anthropic/package.py Adds upper bound to _instruments.
instrumentation/opentelemetry-instrumentation-genai-anthropic/pyproject.toml Adds upper bound to instruments extra.
instrumentation/opentelemetry-instrumentation-genai-agno/tests/test_instrumentor.py Adjusts expected dependency string to include an upper bound.
instrumentation/opentelemetry-instrumentation-genai-agno/src/opentelemetry/instrumentation/genai/agno/package.py Adds upper bound to _instruments.
instrumentation/opentelemetry-instrumentation-genai-agno/pyproject.toml Adds upper bound to instruments extra.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/check_deps.py Outdated
Comment thread scripts/check_deps.py
Comment thread README.md Outdated
@lmolkova lmolkova changed the title [DO NOT MERGE] Enforce lower and upper bounds on instruments dependencies Enforce bounds on instruments dependencies and pin latest test requirements Aug 21, 2026
@lmolkova
lmolkova requested a lite review from Copilot August 21, 2026 00:57
@lmolkova lmolkova changed the title Enforce bounds on instruments dependencies and pin latest test requirements [DO NOT MERGE] Enforce bounds on instruments dependencies and pin latest test requirements Aug 21, 2026
@lmolkova lmolkova added the Skip Changelog PR does not require a changelog entry label Aug 21, 2026

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.

Pull request overview

Copilot reviewed 32 out of 33 changed files in this pull request and generated no new comments.

Suppressed comments (1)

scripts/check_deps.py:236

  • check_latest_requirements builds instrumented_names using Requirement(r) without any error handling. If a future edit introduces an invalid requirement string in pyproject.toml's instruments extra, this script will raise and exit with a traceback instead of reporting a structured dependency-check error (even though check_instruments_match already handles that case). Catch the exception here and return an error entry instead of crashing.

@lmolkova lmolkova changed the title [DO NOT MERGE] Enforce bounds on instruments dependencies and pin latest test requirements Enforce bounds on instruments dependencies and pin latest test requirements Aug 21, 2026
# Conflicts:
#	README.md
#	instrumentation/opentelemetry-instrumentation-genai-anthropic/pyproject.toml
#	instrumentation/opentelemetry-instrumentation-genai-anthropic/src/opentelemetry/instrumentation/genai/anthropic/package.py
#	instrumentation/opentelemetry-instrumentation-genai-anthropic/tests/requirements.latest.txt
#	instrumentation/opentelemetry-instrumentation-genai-anthropic/tests/test_instrumentor.py
#	scripts/check_deps.py
#	uv.lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PR does not require a changelog entry

Development

Successfully merging this pull request may close these issues.

2 participants