Move git_version_info to util
MODIFY
plextraktsync/util/Version.py
plextraktsync/util/Version.py
@@ -16,7 +16,7 @@ def version(self):
return f'{__version__[0:-4]}@pr/{v["pr"]}#{v["short_commit_id"]}'
# If installed with Git
- from plextraktsync.version import git_version_info
+ from plextraktsync.util.git_version_info import git_version_info
gv = git_version_info()
if gv:
return f"{__version__}: {gv}"

ADD
plextraktsync/util/git_version_info.py
+def git_version_info():
+ try:
+ from gitinfo import get_git_info
+ except (ImportError, TypeError):
+ return None
+
+ commit = get_git_info()
+ if not commit:
+ return None
+
+ message = commit["message"].split("\n")[0]
+
+ return f"{commit['commit'][0:8]}: {message} @{commit['author_date']}"

MODIFY
plextraktsync/version.py
plextraktsync/version.py
from plextraktsync.factory import factory
-def git_version_info():
- try:
- from gitinfo import get_git_info
- except (ImportError, TypeError):
- return None
-
- commit = get_git_info()
- if not commit:
- return None
-
- message = commit["message"].split("\n")[0]
-
- return f"{commit['commit'][0:8]}: {message} @{commit['author_date']}"
-
-
def version():
return factory.version.version

Move git_version_info to util