From 893d645d878159dec41021332314838d66ac7bfb Mon Sep 17 00:00:00 2001 From: Luciano Bello Date: Sat, 22 Jul 2023 17:34:17 +0200 Subject: [PATCH] bugfixing --- qiskit/tools/jupyter/version_table.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/qiskit/tools/jupyter/version_table.py b/qiskit/tools/jupyter/version_table.py index 67681ee51674..959e155239c4 100644 --- a/qiskit/tools/jupyter/version_table.py +++ b/qiskit/tools/jupyter/version_table.py @@ -36,7 +36,14 @@ def qiskit_version_table(self, line="", cell=None): html += "" html += "" - packages = {} + packages = {"qiskit": None} + + packages["qiskit-terra"] = qiskit.__version__ + + qiskit_modules = {module.split(".")[0] for module in modules.keys() if "qiskit" in module} + + for qiskit_module in qiskit_modules: + packages[qiskit_module] = getattr(modules[qiskit_module], "__version__", None) from importlib.metadata import metadata, PackageNotFoundError @@ -45,14 +52,9 @@ def qiskit_version_table(self, line="", cell=None): except PackageNotFoundError: packages["qiskit"] = None - packages["qiskit-terra"] = qiskit.__version__ - - qiskit_modules = {module.split(".")[0] for module in modules.keys() if "qiskit" in module} - for qiskit_module in qiskit_modules: - packages[qiskit_module] = getattr(modules[qiskit_module], "__version__", None) - for name, version in packages.items(): - html += f"" + if name == "qiskit" or version: + html += f"" html += ""
SoftwareVersion
{name}{version}
{name}{version}
System information