Skip to content

Commit e239817

Browse files
committed
Add more symbols to opentelemetry.util._importlib_metadata
Fixes open-telemetry#4180
1 parent 9697f80 commit e239817

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

Diff for: opentelemetry-api/src/opentelemetry/util/_importlib_metadata.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,23 @@
1515
# FIXME: Use importlib.metadata when support for 3.11 is dropped if the rest of
1616
# the supported versions at that time have the same API.
1717
from importlib_metadata import ( # type: ignore
18+
Distribution,
1819
EntryPoint,
1920
EntryPoints,
21+
PackageNotFoundError,
22+
distributions,
2023
entry_points,
24+
requires,
2125
version,
2226
)
2327

24-
# The importlib-metadata library has introduced breaking changes before to its
25-
# API, this module is kept just to act as a layer between the
26-
# importlib-metadata library and our project if in any case it is necessary to
27-
# do so.
28-
29-
__all__ = ["entry_points", "version", "EntryPoint", "EntryPoints"]
28+
__all__ = [
29+
"entry_points",
30+
"version",
31+
"EntryPoint",
32+
"EntryPoints",
33+
"requires",
34+
"Distribution",
35+
"distributions",
36+
"PackageNotFoundError",
37+
]

Diff for: opentelemetry-api/tests/util/test__importlib_metadata.py

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from opentelemetry.util._importlib_metadata import (
2020
entry_points as importlib_metadata_entry_points,
2121
)
22+
from opentelemetry.util._importlib_metadata import version
2223

2324

2425
class TestEntryPoints(TestCase):
@@ -106,3 +107,5 @@ def test_uniform_behavior(self):
106107
entry_points = importlib_metadata_entry_points(group="abc", name="abc")
107108
self.assertIsInstance(entry_points, EntryPoints)
108109
self.assertEqual(len(entry_points), 0)
110+
111+
self.assertIsInstance(version("opentelemetry-api"), str)

0 commit comments

Comments
 (0)