From 3ad91b5bc97b4d3191a36e82ed2fc8a4e36640ab Mon Sep 17 00:00:00 2001 From: Nils Quetschlich Date: Wed, 27 Sep 2023 16:19:51 +0200 Subject: [PATCH] Fixing ReadtheDocs (#247) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- docs/conf.py | 23 ++++++++++------------- src/mqt/bench/__init__.py | 2 ++ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 50aefc545..6370445ff 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,20 +10,17 @@ try: - from mqt.bench import __version__ as version + version = metadata.version("mqt.bench") except ModuleNotFoundError: - try: - version = metadata.version("mqt.bench") - except ModuleNotFoundError: - msg = ( - "Package should be installed to produce documentation! " - "Assuming a modern git archive was used for version discovery." - ) - warnings.warn(msg, stacklevel=1) - - from setuptools_scm import get_version - - version = get_version(root=str(ROOT), fallback_root=ROOT) + msg = ( + "Package should be installed to produce documentation! " + "Assuming a modern git archive was used for version discovery." + ) + warnings.warn(msg, stacklevel=1) + + from setuptools_scm import get_version + + version = get_version(root=str(ROOT), fallback_root=ROOT) # Filter git details from version release = version.split("+")[0] diff --git a/src/mqt/bench/__init__.py b/src/mqt/bench/__init__.py index 9c88365a7..071d7c8fe 100644 --- a/src/mqt/bench/__init__.py +++ b/src/mqt/bench/__init__.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from mqt.bench.benchmark_generator import ( generate, get_benchmark,