diff --git a/pyproject.toml b/pyproject.toml index a029e9f6..1a182fbe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "QLever-UI" -version = "0.1.0" +version = "0.5.46" description = "A user-friendly interface for the QLever SPARQL engine" readme = "README.md" requires-python = ">=3.10" diff --git a/qlever/settings.py b/qlever/settings.py index f4debe54..108ae68e 100644 --- a/qlever/settings.py +++ b/qlever/settings.py @@ -11,8 +11,6 @@ """ import os -import subprocess -import re import environ try: @@ -201,18 +199,18 @@ STATIC_VERSION = "Git commit {} on {}".format( GIT_HASH, GIT_HEAD.split("/")[-1] ) -except Exception as e: - print(e) +except OSError: + # Git Info not available pass +except Exception: + # Should not happen + print("Error determining git version.") if not STATIC_VERSION: - # get svn version info if git was not successful + from importlib.metadata import version, PackageNotFoundError try: - versionInfo = ( - subprocess.check_output("svn info -r HEAD;", shell=True) - ).decode("utf-8") - STATIC_VERSION = re.search(r"(Revision: \d+)", versionInfo).group(1) - except: + STATIC_VERSION = "Version: {}".format(version("QLever-UI")) + except PackageNotFoundError: pass IMPORT_EXPORT_USE_TRANSACTIONS = True