Skip to content

Commit

Permalink
Use importlib.version to remove import from show_versions (#6072)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Feb 2, 2024
1 parent b1af8ae commit 960e40b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions holoviews/util/_versions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import platform
import sys
from importlib.metadata import version

__all__ = ("show_versions",)

Expand Down Expand Up @@ -36,6 +37,7 @@
# Misc
"panel",
"param",
"pyviz_comms",
]


Expand All @@ -52,8 +54,7 @@ def show_versions():

def _package_version(p):
try:
__import__(p)
print(f"{p:20}: {sys.modules[p].__version__}")
print(f"{p:20}: {version(p)}")
except ImportError:
print(f"{p:20}: -")

Expand Down

0 comments on commit 960e40b

Please sign in to comment.