Remove packaging as a runtime dependency of opentelemetry-instrumentation-falcon
Summary
opentelemetry-instrumentation-falcon declares packaging >= 20.0 as a runtime
dependency, used solely to compare the installed Falcon version.
Motivation: the auto-instrumentation injector
The auto-instrumentation injector (the Python auto-instrumentation shipped by the
OpenTelemetry Operator) bundles the instrumentation packages and all of their
runtime dependencies into an init container and prepends that directory to the
target application's PYTHONPATH. Every runtime dependency is therefore injected
into the user's application process, where a common library like packaging
risks version shadowing/conflicts and adds to the injected payload. Removing it
shrinks that footprint. See #4882 for the full rationale.
Where it is used
pyproject.toml: packaging >= 20.0 in dependencies.
src/opentelemetry/instrumentation/falcon/__init__.py:229:
package_version.parse(falcon.__version__) compared against 2.0.0 / 3.0.0
to select the correct request/response attribute handling.
Purpose: spec-compliant PEP 440 ordering of falcon.__version__ to branch
behavior by installed Falcon version.
Proposed resolution
Import the PEP 440 Version from the internal implementation added in #4882
(opentelemetry.instrumentation._packaging.version) instead of packaging, and
remove packaging from this package's dependencies.
Depends on #4882, which introduces opentelemetry.instrumentation._packaging
in opentelemetry-instrumentation (a dependency of this package).
Remove
packagingas a runtime dependency ofopentelemetry-instrumentation-falconSummary
opentelemetry-instrumentation-falcondeclarespackaging >= 20.0as a runtimedependency, used solely to compare the installed Falcon version.
Motivation: the auto-instrumentation injector
The auto-instrumentation injector (the Python auto-instrumentation shipped by the
OpenTelemetry Operator) bundles the instrumentation packages and all of their
runtime dependencies into an init container and prepends that directory to the
target application's
PYTHONPATH. Every runtime dependency is therefore injectedinto the user's application process, where a common library like
packagingrisks version shadowing/conflicts and adds to the injected payload. Removing it
shrinks that footprint. See #4882 for the full rationale.
Where it is used
pyproject.toml:packaging >= 20.0independencies.src/opentelemetry/instrumentation/falcon/__init__.py:229:package_version.parse(falcon.__version__)compared against2.0.0/3.0.0to select the correct request/response attribute handling.
Purpose: spec-compliant PEP 440 ordering of
falcon.__version__to branchbehavior by installed Falcon version.
Proposed resolution
Import the PEP 440
Versionfrom the internal implementation added in #4882(
opentelemetry.instrumentation._packaging.version) instead ofpackaging, andremove
packagingfrom this package'sdependencies.Depends on #4882, which introduces
opentelemetry.instrumentation._packagingin
opentelemetry-instrumentation(a dependency of this package).