import subprocess
import os
from typing import Any

import psutil


def get_git_tag() -> str:
    try:
        tag = (
            subprocess.check_output(["git", "describe", "--tags", "--always"])
            .decode("ascii")
            .strip()
        )
    except Exception:
        tag = "version_unknown"
    return tag


def get_clean_git_tag() -> str:
    clean_tag = ""
    tag = get_git_tag()
    for i in tag:
        if i != "-":
            clean_tag += i
        else:
            return clean_tag
    return clean_tag

import subprocess
import os
from typing import Any

import psutil


def get_git_tag() -> str:
    try:
        tag = (
            subprocess.check_output(["git", "describe", "--tags", "--always"])
            .decode("ascii")
            .strip()
        )
    except Exception:
        tag = "version_unknown"
    return tag


def get_clean_git_tag() -> str:
    clean_tag = ""
    tag = get_git_tag()
    for i in tag:
        if i != "-":
            clean_tag += i
        else:
            return clean_tag
    return clean_tag
