23 lines
621 B
Python
23 lines
621 B
Python
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
|
|
|
|
def print_version() -> None:
|
|
print(f"YREA SLS ({SLS_NAME}) {SLS_VERSION} ({SLS_COMMIT})")
|
|
print(f"Running on {INTERPRETER_NAME} {INTERPRETER_VER} at {MODULE_TIMESTAMP}")
|