Skip to content

Commit 8e43054

Browse files
committed
elasticotel: use importlib_metadata shim instead of pkg-resources
1 parent 23b9f83 commit 8e43054

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/elasticotel/distro/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
OTEL_EXPERIMENTAL_RESOURCE_DETECTORS,
3434
OTEL_EXPORTER_OTLP_PROTOCOL,
3535
)
36-
from pkg_resources import EntryPoint
36+
from opentelemetry.util._importlib_metadata import EntryPoint
3737

3838
from elasticotel.distro.environment_variables import ELASTIC_OTEL_SYSTEM_METRICS_ENABLED
3939

tests/integration/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
from typing import Callable, Mapping, Optional
2525

2626
import leb128
27-
import pkg_resources
27+
from opentelemetry.util._importlib_metadata import version
2828
from oteltest import private as ot
2929

30-
OTEL_VERSION = pkg_resources.get_distribution("opentelemetry-api").version
31-
OTEL_INSTRUMENTATION_VERSION = pkg_resources.get_distribution("opentelemetry-instrumentation").version
30+
OTEL_VERSION = version("opentelemetry-api")
31+
OTEL_INSTRUMENTATION_VERSION = version("opentelemetry-instrumentation")
3232

3333
ROOT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
3434

0 commit comments

Comments
 (0)