mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 10:31:50 +01:00
use more predictable version numbers
This commit is contained in:
13
version.py
Normal file
13
version.py
Normal file
@@ -0,0 +1,13 @@
|
||||
"""
|
||||
SPDX-FileCopyrightText: © Sebastian Thomschke and contributors
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
SPDX-ArtifactOfProjectHomePage: https://github.com/Second-Hand-Friends/kleinanzeigen-bot/
|
||||
"""
|
||||
from datetime import datetime
|
||||
import subprocess
|
||||
|
||||
|
||||
# used in pyproject.toml [tool.pdm.version]
|
||||
def get_version() -> str:
|
||||
commit_hash = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode().strip()
|
||||
return f"{datetime.now().year}+{commit_hash}"
|
||||
Reference in New Issue
Block a user