Skip to content

fix(distro): stop pinning wrapt, packaging, asgiref, psutil and typing-extensions in the published metadata - #215

Draft
ocelotl wants to merge 1 commit into
mainfrom
issue_150_relax_support_library_pins
Draft

ocelotl wants to merge 1 commit into
mainfrom
issue_150_relax_support_library_pins

Conversation

@ocelotl

@ocelotl ocelotl commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Closes #150

What was broken

packages/dash0-opentelemetry/pyproject.toml declared asgiref == 3.12.1, packaging==26.3, psutil == 7.2.2, typing-extensions == 4.16.0 and wrapt == 1.17.3. The pins go into the wheel's Requires-Dist, so they bind every application that runs pip install dash0-opentelemetry, and every one of these libraries is common in applications:

scenario, against a wheel built from main (0.4.1 metadata) result
uv pip compile of dash0-opentelemetry with wrapt==2.5.2, packaging==26.4, asgiref==3.13.0 or typing_extensions==4.15.0 all four: no solution
venv with Django 6.1.3, Deprecated, wrapt 2.5.2 and asgiref 3.13.0, then pip install dash0-opentelemetry exit 0, wrapt 1.17.3 and asgiref 3.12.1 installed, pip check clean, no warning
one pip install -r of fastapi, wrapt==2.5.2, dash0-opentelemetry ResolutionImpossible

The silent downgrade is the inverse of #124: the injector accepts wrapt 2.x now, but the PyPI install path forces it back to 1.17.3.

Why the pins were there, and how this keeps that

The comment on the dependency block and the README's dependency policy (#7, 789f43b, extended to the whole closure in ee4d6fa/#4) give the reason: each release is validated against one exact tree, and that tree is spelled out in this file with nothing left to transitive resolution. The consumer that needs it is the injected tree. The dash0-operator image and this repository's e2e images build that tree with pip install --target, so the published metadata was the only thing fixing what that tree contains.

The two needs are separate, so this PR declares them separately:

  • dependencies lists the five support libraries without a version. The packages that need them already declare the ranges they support (wrapt<3.0.0,>=1.0.0,>=1.11.2,>=1.12.1, asgiref~=3.0, packaging>=18.0,>=20.0,>=21.0, psutil<8,>=5.9.0, typing-extensions>=4.5.0,~=4.1, the same lines all-dependencies.txt already carries). Copying those ranges into our metadata would only go stale the next time upstream widens one.
  • A new pinned extra carries the exact pins. pip install --target <dir> 'dash0-opentelemetry[pinned]' gives the validated tree, unchanged: asgiref 3.12.1, packaging 26.3, psutil 7.2.2, typing-extensions 4.16.0, wrapt 1.17.3.
  • scripts/refresh_injector_manifest.py, tests/e2e-instrumentations/Dockerfile.injected and tests/e2e-kubernetes/instrumentation/Dockerfile install the extra. all-dependencies.txt does not change: a bare requirement adds no constraint, and generate_all_dependencies.py skips extra-gated requirements.
  • uv.lock still locks the five to the same versions, so the dev environment and the unit tests run against the validated tree.

The guarantee now holds only for builds that ask for the extra. The dash0-operator needs a follow-up: images/instrumentation/Dockerfile installs /tmp/dash0-python-distribution/packages/dash0-opentelemetry in both Python stages, and that path should become .../dash0-opentelemetry[pinned] when the operator moves to the release that carries this. Until then its build would pick the newest versions within upstream's ranges. That is still a working tree, but not the validated one. The DEB/RPM builds in dash0-packages should be checked the same way. pip has no default extras, so I found no way to make this automatic for existing consumers.

Why the OpenTelemetry pins stay

They are not in this PR on purpose. Upstream already pins them to each other: opentelemetry-sdk 1.45.2 requires opentelemetry-api==1.45.2 and opentelemetry-semantic-conventions==0.66b2, and every contrib instrumentation requires opentelemetry-instrumentation==0.66b2 and the matching semantic conventions. An application with another OpenTelemetry release train conflicts with the instrumentations whatever this file says. A range here would only let the resolver choose a train nobody validated, and the distro's own code (the configurator, the vendored dash0-opentelemetry-configuration 0.66b2.post1, the vendored asyncclick instrumentation) is built against this one. Relaxing them is a separate design decision with its own tradeoffs.

The check that catches a regression

  • scripts/check_pinned_dependencies.py (CI lint job): any version on a support library in dependencies is now a violation, and so is a support library missing from the pinned extra, a range in that extra, or a lock file closure that differs from the pins in either place. Only opentelemetry-* names (plus workspace members and the existing EXEMPT_FROM_EXACT_PIN table) may be pinned in dependencies. scripts/tests/test_check_pinned_dependencies.py covers each rule. test_an_exact_pin_on_a_support_library_in_dependencies_is_rejected is the Five exact pins on ubiquitous libraries make pip install dash0-opentelemetry fail or silently downgrade the application #150 regression and fails against the old script, which accepted that pin.
  • A new build-job step resolves the built wheel next to each of the issue's four versions with uv pip compile. Run against a wheel built from main it fails on the first pin ("all versions of dash0-opentelemetry depend on wrapt==1.17.3").

The distribution moves to 0.4.2, because 0.4.1 is in scripts/index-manifest.json. #159 makes the same bump, so whichever merges second rebases.

Verification

Every check below ran on this branch with uv 0.12.9 and Python 3.13.

check result
issue scenarios against this branch's wheel all four pins resolve; the Django venv keeps wrapt 2.5.2 and asgiref 3.13.0, pip check clean; fastapi + wrapt==2.5.2 installs
uv pip install --target of dash0-opentelemetry[pinned] asgiref 3.12.1, packaging 26.3, psutil 7.2.2, typing_extensions 4.16.0, wrapt 1.17.3
pip install --target with the Dockerfile.injected arguments same five versions, dash0 wheels from file://
uv run --no-project --python 3.13 scripts/check_pinned_dependencies.py passed
python scripts/refresh_injector_manifest.py --check all-dependencies.txt unchanged
uv lock --check, scripts/check_version_bumped.py passed
pytest scripts/tests 67 passed
pytest packages/dash0-opentelemetry/tests (3.13) 227 passed
ruff check / format --check passed

make chlog-validate and the Docker e2e suites were not run locally (no Go or Docker in my environment); CI runs them.

@ocelotl
ocelotl force-pushed the issue_150_relax_support_library_pins branch from 4db2d80 to 5aeb33e Compare November 30, 2026 17:19
…g-extensions in the published metadata

The distribution declared these five support libraries with == pins so the
injected tree was spelled out in one file. The pins also reach PyPI, so
pip install dash0-opentelemetry next to wrapt 2.5.2, packaging 26.4,
asgiref 3.13.0 or typing_extensions 4.15.0 failed to resolve, and in a
Django app with Deprecated it replaced wrapt 2.5.2 and asgiref 3.13.0 with
1.17.3 and 3.12.1 without a warning.

Declare them without a version, so the ranges the OpenTelemetry packages
declare decide, and move the exact pins to a new "pinned" extra. Builds of
an injected tree install dash0-opentelemetry[pinned] and keep shipping
exactly the validated versions: the e2e images and
refresh_injector_manifest.py now do. all-dependencies.txt does not change,
because a bare requirement adds no constraint and extra-gated requirements
are skipped.

check_pinned_dependencies.py now rejects any version on a support library
in dependencies, requires each to be pinned in the extra, and checks the
lock file's closure against the pins in either place. A build-job step
resolves the built wheel next to each version from the issue.

The OpenTelemetry pins stay: upstream already pins the SDK, semantic
conventions and every contrib instrumentation to each other exactly, so a
range here would only let the resolver pick a release train nobody
validated.

Fixes #150
@ocelotl
ocelotl force-pushed the issue_150_relax_support_library_pins branch from 5aeb33e to 0d0c0bf Compare November 30, 2026 17:32

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Five exact pins on ubiquitous libraries make pip install dash0-opentelemetry fail or silently downgrade the application

1 participant