feat: auto-derive version from git tags using setuptools-scm

Replace hardcoded version with setuptools-scm so the version updates
automatically from git tags. The ASCII banner strips the dirty date
suffix but preserves the git node hash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Justin Bollinger
2026-02-13 21:58:17 -05:00
co-authored by Claude Opus 4.6
parent a5e3b65030
commit 8d45881c7e
4 changed files with 16 additions and 5 deletions
+1
View File
@@ -1,6 +1,7 @@
config.json config.json
hashcat.pot hashcat.pot
hate_crack/__init__.pyc hate_crack/__init__.pyc
hate_crack/_version.py
__pycache__/ __pycache__/
hate_crack/__pycache__/ hate_crack/__pycache__/
tests/__pycache__/ tests/__pycache__/
+3
View File
@@ -1 +1,4 @@
# hate_crack package # hate_crack package
from hate_crack._version import __version__, __version_tuple__
__all__ = ["__version__", "__version_tuple__"]
+7 -3
View File
@@ -773,15 +773,19 @@ def usage():
def ascii_art(): def ascii_art():
import re
from hate_crack import __version__
version = re.sub(r"\.d\d{8}$", "", __version__)
print(r""" print(r"""
___ ___ __ _________ __ ___ ___ __ _________ __
/ | \_____ _/ |_ ____ \_ ___ \____________ ____ | | __ / | \_____ _/ |_ ____ \_ ___ \____________ ____ | | __
/ ~ \__ \\ __\/ __ \ / \ \/\_ __ \__ \ _/ ___\| |/ / / ~ \__ \\ __\/ __ \ / \ \/\_ __ \__ \ _/ ___\| |/ /
\ Y // __ \| | \ ___/ \ \____| | \// __ \\ \___| < \ Y // __ \| | \ ___/ \ \____| | \// __ \\ \___| <
\___|_ /(____ /__| \___ >____\______ /|__| (____ /\___ >__|_ \ \___|_ /(____ /__| \___ >____\______ /|__| (____ /\___ >__|_ \
\/ \/ \/_____/ \/ \/ \/ \/ \/ \/ \/_____/ \/ \/ \/ \/
Version 2.0 Version """ + version + """
""") """)
+5 -2
View File
@@ -1,10 +1,10 @@
[build-system] [build-system]
requires = ["setuptools>=69"] requires = ["setuptools>=69", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
[project] [project]
name = "hate_crack" name = "hate_crack"
version = "2.0" dynamic = ["version"]
description = "Menu driven Python wrapper for hashcat" description = "Menu driven Python wrapper for hashcat"
readme = "README.md" readme = "README.md"
requires-python = ">=3.13" requires-python = ">=3.13"
@@ -37,6 +37,9 @@ hate_crack = [
"princeprocessor/**", "princeprocessor/**",
] ]
[tool.setuptools_scm]
version_file = "hate_crack/_version.py"
[tool.ruff] [tool.ruff]
exclude = [ exclude = [
"build", "build",