Fix #2803: 🚀 Feature: Install less packages#3997
Fix #2803: 🚀 Feature: Install less packages#3997mattiagggg wants to merge 2 commits intotraceloop:mainfrom
Conversation
Move all LLM/AI-provider instrumentation packages from hard dependencies to optional extras in traceloop-sdk's pyproject.toml. Keep only core infrastructure packages (requests, urllib3, logging, threading, sqlalchemy, redis) as hard dependencies. Add per-provider extras (e.g., `pip install traceloop-sdk[openai]`) and an `all` extra for the current behavior. No runtime code changes needed — the SDK already uses conditional imports via `is_package_installed()` checks.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughMoved 30+ OpenTelemetry instrumentation packages in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/traceloop-sdk/pyproject.toml`:
- Around line 40-103: The extras for optional instrumentation (the individual
extras like agno, alephalpha, anthropic, ..., writer and the combined "all"
list) currently pin no minimum version for opentelemetry-instrumentation
packages; update each entry to require at least the SDK-compatible minimum
(e.g., "opentelemetry-instrumentation-<provider> >=0.59b0") and mirror the same
>=0.59b0 specifier for every package string inside the all list so all 31
provider extras enforce the minimum version floor.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5d83c7e6-d4bb-4fb6-823a-c1219263a4a8
📒 Files selected for processing (1)
packages/traceloop-sdk/pyproject.toml
…xtras Ensures all provider extras and the `all` list enforce a minimum version compatible with SDK 0.59.0, matching the floor used by core instrumentation dependencies. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Move all LLM/AI-provider instrumentation packages from hard dependencies to optional extras, significantly reducing the default install footprint. Users can now install only the instrumentations they need (e.g.,
pip install traceloop-sdk[openai]) or opt into the full set withtraceloop-sdk[all].Changes
dependencieslist[openai],[anthropic],[langchain], etc.) for granular installs[all]extra that installs every instrumentation package, preserving backwards compatibility for users who want the previous behaviorTesting
traceloop-sdkwithout extras and verify only core deps are installed — no provider-specific packages should be presenttraceloop-sdk[openai]and verify only the OpenAI instrumentation is pulled intraceloop-sdk[all]and verify all instrumentation packages are installed (backwards-compat)Traceloop.init()continues to work gracefully when instrumentation packages are absent — the SDK already usesis_package_installed()checks for conditional importsCloses #2803
Summary by CodeRabbit