Skip to content

Commit b495cf6

Browse files
committed
fix: consider all packages' entry points
1 parent 4b46973 commit b495cf6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ibis/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,9 @@
5252
)
5353

5454
try:
55-
_distribution_name = __name__
5655
__version__ = importlib_metadata.version(__name__)
5756
except Exception:
58-
_distribution_name = "ibis-framework"
59-
__version__ = importlib_metadata.version(_distribution_name)
57+
__version__ = importlib_metadata.version("ibis-framework")
6058

6159

6260
def __getattr__(name: str) -> BaseBackend:
@@ -74,10 +72,10 @@ def __getattr__(name: str) -> BaseBackend:
7472
the `ibis.backends` entrypoints. If successful, the `ibis.sqlite`
7573
attribute is "cached", so this function is only called the first time.
7674
"""
77-
distribution = importlib_metadata.distribution(_distribution_name)
75+
ibis_entry_points = importlib_metadata.entry_points()["ibis.backends"]
7876
entry_points = [
7977
entry_point
80-
for entry_point in distribution.entry_points
78+
for entry_point in ibis_entry_points
8179
if name == entry_point.name
8280
]
8381

0 commit comments

Comments
 (0)