mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-31 14:11:50 +08:00
Remove pkg resources (#2871)
This commit is contained in:

committed by
GitHub

parent
d7d7e96ce5
commit
e4ece57a81
@ -1,6 +1,5 @@
|
||||
asgiref==3.8.1
|
||||
Deprecated==1.2.14
|
||||
importlib-metadata==6.11.0
|
||||
iniconfig==2.0.0
|
||||
packaging==24.0
|
||||
pluggy==1.5.0
|
||||
|
@ -16,21 +16,23 @@
|
||||
import os
|
||||
from unittest import TestCase, mock
|
||||
|
||||
from pkg_resources import DistributionNotFound, require
|
||||
|
||||
from opentelemetry.distro import OpenTelemetryDistro
|
||||
from opentelemetry.environment_variables import (
|
||||
OTEL_METRICS_EXPORTER,
|
||||
OTEL_TRACES_EXPORTER,
|
||||
)
|
||||
from opentelemetry.sdk.environment_variables import OTEL_EXPORTER_OTLP_PROTOCOL
|
||||
from opentelemetry.util._importlib_metadata import (
|
||||
PackageNotFoundError,
|
||||
version,
|
||||
)
|
||||
|
||||
|
||||
class TestDistribution(TestCase):
|
||||
def test_package_available(self):
|
||||
try:
|
||||
require(["opentelemetry-distro"])
|
||||
except DistributionNotFound:
|
||||
version("opentelemetry-distro")
|
||||
except PackageNotFoundError:
|
||||
self.fail("opentelemetry-distro not installed")
|
||||
|
||||
@mock.patch.dict("os.environ", {}, clear=True)
|
||||
|
Reference in New Issue
Block a user