Skip to content

Commit 2268275

Browse files
committed
feat: better formatting for print_debug_info
1 parent 6344c0b commit 2268275

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/zarr/__init__.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,16 @@ def print_debug_info() -> None:
4545
from importlib.metadata import version
4646

4747
def print_packages(packages: list[str]) -> None:
48+
not_installed = []
4849
for package in packages:
4950
try:
5051
print(f"{package}: {version(package)}")
5152
except ModuleNotFoundError:
52-
continue
53+
not_installed.append(package)
54+
if not_installed:
55+
print("\n**Not Installed:**")
56+
for package in not_installed:
57+
print(package)
5358

5459
required = [
5560
"packaging",
@@ -71,12 +76,11 @@ def print_packages(packages: list[str]) -> None:
7176
]
7277

7378
print(f"platform: {platform.platform()}")
74-
print(f"python: {platform.python_version()}\n")
75-
79+
print(f"python: {platform.python_version()}")
7680
print(f"zarr: {__version__}\n")
77-
print("Required dependencies:")
81+
print("**Required dependencies:**")
7882
print_packages(required)
79-
print("Optional dependencies:")
83+
print("\n**Optional dependencies:**")
8084
print_packages(optional)
8185

8286

0 commit comments

Comments
 (0)