Remove packaging as a runtime dependency of opentelemetry-instrumentation - #4883
Open
ocelotl wants to merge 2 commits into
Open
Remove packaging as a runtime dependency of opentelemetry-instrumentation#4883ocelotl wants to merge 2 commits into
packaging as a runtime dependency of opentelemetry-instrumentation#4883ocelotl wants to merge 2 commits into
Conversation
ocelotl
force-pushed
the
issue_4882_remove_packaging_dependency
branch
from
July 28, 2026 22:23
d009c76 to
d13f378
Compare
This was referenced Jul 28, 2026
packaging as a runtime dependency of the instrumentation packagespackaging as a runtime dependency of opentelemetry-instrumentation
ocelotl
force-pushed
the
issue_4882_remove_packaging_dependency
branch
3 times, most recently
from
July 28, 2026 23:10
476387a to
6de1be6
Compare
ocelotl
marked this pull request as ready for review
July 28, 2026 23:14
Adds opentelemetry.instrumentation._packaging with PEP 440 Version and PEP 508 Requirement/specifier/marker support, implementing the subset of packaging used by opentelemetry-instrumentation. Behaviour was validated against packaging across a large corpus of version/specifier/marker/requirement inputs.
Points _semconv (version comparison) and dependencies.py/bootstrap.py (requirement parsing) at opentelemetry.instrumentation._packaging, removes packaging from opentelemetry-instrumentation's runtime dependencies and refreshes uv.lock.
ocelotl
force-pushed
the
issue_4882_remove_packaging_dependency
branch
from
July 28, 2026 23:23
6de1be6 to
ebabae2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Removes
packagingas a runtime dependency ofopentelemetry-instrumentation,replacing its use with a small internal implementation under
opentelemetry.instrumentation._packaging:Version(parsing, normalization, ordering) for the schema-versioncomparison in
_semconv.py.Requirementparsing plus PEP 440 specifier containment and markerevaluation for the dependency-conflict machinery in
dependencies.pyandbootstrap.py.packagingis dropped fromopentelemetry-instrumentation'sdependencies.Motivation: the auto-instrumentation injector ships instrumentation and its
runtime dependencies onto the target application's
PYTHONPATH, so every runtimedependency (like
packaging) is injected into the user's process and risksversion shadowing/conflicts. See the issue for details.
The same removal for the four instrumentations that depend on
packaging(falcon #4884, flask #4885, pika #4886, sqlalchemy #4887) is handled in separate
PRs that reuse the internal implementation introduced here.
Fixes #4882
Type of change
How Has This Been Tested?
modules (
tests/test_packaging_*.py).packagingacross a broadcorpus of PEP 440 versions and specifiers (parsing, normalization, attributes
and ordering) with no divergence.
test_dependencies.pycontinues to pass against the internalimplementation.
Does This PR Require a Core Repo Change?
Checklist: