mirror of
https://github.com/creyD/creyPY.git
synced 2026-04-12 19:30:30 +02:00
Added automated versioning
This commit is contained in:
19
setup.py
19
setup.py
@@ -1,11 +1,28 @@
|
||||
import subprocess
|
||||
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
with open("requirements.txt") as f:
|
||||
requirements = f.read().splitlines()
|
||||
|
||||
|
||||
def get_latest_git_tag() -> str:
|
||||
try:
|
||||
tag = (
|
||||
subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"])
|
||||
.strip()
|
||||
.decode("utf-8")
|
||||
)
|
||||
if tag.startswith("v"):
|
||||
tag = tag[1:]
|
||||
except subprocess.CalledProcessError:
|
||||
raise RuntimeError("Unable to get latest git tag")
|
||||
return str(tag)
|
||||
|
||||
|
||||
setup(
|
||||
name="creyPY",
|
||||
version="0.0.9",
|
||||
version=get_latest_git_tag(),
|
||||
description="My collection of Python and FastAPI shortcuts etc.",
|
||||
author="Conrad Großer",
|
||||
author_email="conrad@noah.tech",
|
||||
|
||||
Reference in New Issue
Block a user