mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 18:41:50 +01:00
14 lines
475 B
Python
14 lines
475 B
Python
"""
|
|
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}"
|