import sys
try:
    from ._version import version, commit, timestamp # type: ignore
except ImportError:
    version = "unknown"
    commit = "unknown"
    timestamp = "unknown"


SLS_NAME = "SLS_PYTHON"
SLS_VERSION = version
SLS_COMMIT = commit

# Runtime interpreter info (Python equivalent of compiler)
_impl = sys.implementation
INTERPRETER_NAME = _impl.name.capitalize()
INTERPRETER_VER = _impl.version.major
MODULE_TIMESTAMP = timestamp

SLS_INFO_STRING_1 = f"YREA SLS ({SLS_NAME}) {SLS_VERSION} ({SLS_COMMIT})"
SLS_INFO_STRING_2 = f"Running on {INTERPRETER_NAME} {INTERPRETER_VER} at {MODULE_TIMESTAMP}"

def print_version() -> None:
    print(SLS_INFO_STRING_1)
    print(SLS_INFO_STRING_2)
