From 137270b8862ee0c3c5a65cf6c849f9a4300ef227 Mon Sep 17 00:00:00 2001 From: snowy Date: Sun, 18 Aug 2024 04:22:03 +0800 Subject: [PATCH] =?UTF-8?q?:children=5Fcrossing:=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liteyuki/__init__.py | 3 +++ liteyuki/version.py | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/liteyuki/__init__.py b/liteyuki/__init__.py index 42dbab82..7736ef02 100644 --- a/liteyuki/__init__.py +++ b/liteyuki/__init__.py @@ -20,6 +20,8 @@ from liteyuki.log import ( logger ) +from liteyuki.version import __version__ + __all__ = [ "LiteyukiBot", @@ -32,6 +34,7 @@ __all__ = [ "load_plugins", "init_log", "logger", + "__version__" ] diff --git a/liteyuki/version.py b/liteyuki/version.py index 069cb9c9..44f7a2d0 100644 --- a/liteyuki/version.py +++ b/liteyuki/version.py @@ -8,13 +8,15 @@ Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved @File : version.py.py @Software: PyCharm """ +from datetime import datetime + from git import Repo from pdm.backend.hooks.version import SCMVersion -__commit__ = Repo(".").head.commit.hexsha +__datetime__ = datetime.now().strftime("%Y-%m-%d %H:%M:%S") __version__ = "6.3.5" def format_version(version: SCMVersion) -> str: - return f"{__version__}.dev{int(__commit__[:7], 16)}" + return f"{__version__}.dev{__datetime__}"