Skip to content

Commit 48ed221

Browse files
authored
Clean up and unify dependency versions (#244)
* clean up examples and dependency versions * up * feedback * feedback * changelogs * uv lock
1 parent 8bbcd98 commit 48ed221

33 files changed

Lines changed: 106 additions & 85 deletions

File tree

.github/instructions/instrumentation.instructions.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,11 @@ New instrumentations must ship a minimal example under the package's `examples/`
113113
- Versions use the OpenTelemetry beta versioning format `MAJOR.MINORbN` (e.g. `1.0b0`);
114114
`version.py` carries a `.dev` suffix during development.
115115

116+
## 10. Dependency versioning and compatibility
117+
118+
- Reject dependency changes in `pyproject.toml` that unnecessarily pin versions to exact patch ranges (like `== x.y.z` or `~= x.y.z`).
119+
- Prefer ranges that allow minor updates (e.g., `~= x.y` or `>= x.y.z, < (x+1)`).
120+
- For OpenTelemetry-owned beta/pre-release packages (e.g., `opentelemetry-instrumentation`, `opentelemetry-semantic-conventions`, `opentelemetry-util-genai`), enforce the use of `>=` specifiers while pinning the upper boundary to the next major version (e.g., `>= 0.64b0, <1` for `0.x` packages, or `>= 1.0b0, <2` for `1.x` packages) instead of `~=`.
121+
122+
116123
See also [AGENTS.md](../../AGENTS.md) for general repo rules.

.github/renovate.json5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// Default pip_requirements fileMatch only allows [\w-]* between
1212
// "requirements" and ".txt", so per-instrumentation
1313
// requirements.latest.txt files are skipped without this.
14-
"managerFilePatterns": ["/(^|/)requirements\\.latest\\.txt$/"]
14+
"managerFilePatterns": ["/(^|/)requirements\\.txt$/", "/(^|/)requirements\\.latest\\.txt$/"]
1515
},
1616
// Manage WEAVER_VERSION and SEMCONV_GENAI_REF in versions.env via their
1717
// `# renovate:` annotations.

AGENTS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ own `pyproject.toml` and `tests/`. The util package follows the equivalent layou
5050
- Packages use the OpenTelemetry beta versioning format `MAJOR.MINORbN` (e.g. `1.0b0`). `version.py` carries a `.dev`
5151
suffix during development (`1.0b0.dev`); the release workflow drops it.
5252

53+
## Dependency versioning and compatibility
54+
55+
- Use compatible release specifiers (e.g., `~= x.y` or `>= x.y.z, < (x+1)`) that pin the major version and allow minor/patch updates.
56+
- Avoid pinning versions to exact patch ranges (like `== x.y.z` or `~= x.y.z`) in `pyproject.toml` unless strictly necessary.
57+
- Keep version requirements for shared OpenTelemetry packages (e.g., `opentelemetry-api`, `opentelemetry-instrumentation`, and `opentelemetry-semantic-conventions`) consistent across all packages.
58+
- For OpenTelemetry-owned beta/pre-release packages (e.g., `opentelemetry-instrumentation`, `opentelemetry-semantic-conventions`, `opentelemetry-util-genai`), use `>=` specifiers and pin the upper boundary to the next major version (e.g., `>= 0.64b0, <1` for `0.x` packages, or `>= 1.0b0, <2` for `1.x` packages) rather than using `~=`.
59+
60+
5361
## Adding a package to the workspace
5462

5563
A new package under `instrumentation/<pkg>/` (where `<pkg>` is the full
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
anthropic>=0.116.0
22
opentelemetry-sdk~=1.43.0
3-
opentelemetry-instrumentation-genai-anthropic
3+
opentelemetry-instrumentation-genai-anthropic~=1.0b0
44
opentelemetry-exporter-otlp-proto-grpc~=1.43.0
55

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
anthropic>=0.116.0
22
opentelemetry-sdk~=1.43.0
3-
opentelemetry-distro~=0.49b2
4-
opentelemetry-instrumentation-genai-anthropic
3+
opentelemetry-distro~=0.64b0
4+
opentelemetry-instrumentation-genai-anthropic~=1.0b0
55
opentelemetry-exporter-otlp-proto-grpc~=1.43.0
66

instrumentation/opentelemetry-instrumentation-genai-anthropic/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ classifiers = [
2626
]
2727
dependencies = [
2828
"opentelemetry-api ~= 1.43",
29-
"opentelemetry-instrumentation ~= 0.64b0",
30-
"opentelemetry-semantic-conventions ~= 0.64b0",
31-
"opentelemetry-util-genai >= 1.0b0.dev",
29+
"opentelemetry-instrumentation >= 0.64b0, <1",
30+
"opentelemetry-semantic-conventions >= 0.64b0, <1",
31+
"opentelemetry-util-genai >= 1.0b0, <2",
3232
]
3333

3434
[project.optional-dependencies]

instrumentation/opentelemetry-instrumentation-genai-anthropic/tests/test_async_wrappers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,9 @@ def test_sync_manager_does_not_create_invocation_until_enter():
329329
factory_calls = []
330330
wrapper = MessagesStreamManagerWrapper(
331331
manager=_FakeSyncManager(stream=stream),
332-
invocation_factory=lambda: factory_calls.append(True)
333-
or _make_invocation(),
332+
invocation_factory=lambda: (
333+
factory_calls.append(True) or _make_invocation()
334+
),
334335
capture_content=False,
335336
)
336337

instrumentation/opentelemetry-instrumentation-genai-claude-agent-sdk/examples/manual/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ anyio>=4.14.1
33

44
opentelemetry-sdk~=1.43.0
55
opentelemetry-exporter-otlp-proto-grpc~=1.43.0
6-
opentelemetry-instrumentation-genai-claude-agent-sdk
6+
opentelemetry-instrumentation-genai-claude-agent-sdk~=1.0b0

instrumentation/opentelemetry-instrumentation-genai-claude-agent-sdk/examples/zero-code/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ anyio>=4.14.1
33

44
opentelemetry-sdk~=1.43.0
55
opentelemetry-exporter-otlp-proto-grpc~=1.43.0
6-
opentelemetry-distro~=0.57b0
7-
opentelemetry-instrumentation-genai-claude-agent-sdk
6+
opentelemetry-distro~=0.64b0
7+
opentelemetry-instrumentation-genai-claude-agent-sdk~=1.0b0

instrumentation/opentelemetry-instrumentation-genai-claude-agent-sdk/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ classifiers = [
2525
]
2626
dependencies = [
2727
"opentelemetry-api ~= 1.43",
28-
"opentelemetry-instrumentation ~= 0.64b0",
29-
"opentelemetry-semantic-conventions ~= 0.64b0",
30-
"opentelemetry-util-genai >= 1.0b0.dev",
28+
"opentelemetry-instrumentation >= 0.64b0, <1",
29+
"opentelemetry-semantic-conventions >= 0.64b0, <1",
30+
"opentelemetry-util-genai >= 1.0b0, <2",
3131
]
3232

3333
[project.optional-dependencies]

0 commit comments

Comments
 (0)