mirror of
https://github.com/trustedsec/hate_crack.git
synced 2026-03-12 21:23:05 -07:00
fix: clean version string to show 2.0+g<hash> format
Strip .postN.devN and .dYYYYMMDD suffixes from setuptools-scm version in __init__.py so the banner displays a clean version like 2.0+g05b5d6dc7. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,13 @@
|
||||
# hate_crack package
|
||||
from hate_crack._version import __version__, __version_tuple__
|
||||
import re as _re
|
||||
|
||||
from hate_crack._version import __version__ as _raw_version
|
||||
from hate_crack._version import __version_tuple__
|
||||
|
||||
# Clean setuptools-scm version for display:
|
||||
# "2.0.post1.dev0+g05b5d6dc7.d20260214" → "2.0+g05b5d6dc7"
|
||||
# "2.0.post1.dev1+g1234abc" → "2.0+g1234abc"
|
||||
# "2.0" → "2.0"
|
||||
__version__ = _re.sub(r"(\.post\d+\.dev\d+|\.d\d{8})", "", _raw_version)
|
||||
|
||||
__all__ = ["__version__", "__version_tuple__"]
|
||||
|
||||
@@ -773,10 +773,8 @@ def usage():
|
||||
|
||||
|
||||
def ascii_art():
|
||||
import re
|
||||
from hate_crack import __version__
|
||||
|
||||
version = re.sub(r"\.d\d{8}$", "", __version__)
|
||||
print(r"""
|
||||
|
||||
___ ___ __ _________ __
|
||||
@@ -785,7 +783,7 @@ def ascii_art():
|
||||
\ Y // __ \| | \ ___/ \ \____| | \// __ \\ \___| <
|
||||
\___|_ /(____ /__| \___ >____\______ /|__| (____ /\___ >__|_ \
|
||||
\/ \/ \/_____/ \/ \/ \/ \/
|
||||
Version """ + version + """
|
||||
Version """ + __version__ + """
|
||||
""")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user