Add kumacli version and link it into setup.py

This commit is contained in:
Pim van Pelt
2025-08-03 12:36:51 +02:00
parent 7eafb1e68e
commit 41692b7dc1
5 changed files with 70 additions and 4 deletions

View File

@@ -1,13 +1,27 @@
#!/usr/bin/env python3
import os
import re
from setuptools import setup, find_packages
# Read version directly from version.py file without importing
def get_version():
version_file = os.path.join(os.path.dirname(__file__), 'src', 'kumacli', 'cmd', 'version.py')
with open(version_file, 'r', encoding='utf-8') as f:
content = f.read()
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", content, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
__version__ = get_version()
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name="kumacli",
version="1.3.0",
version=__version__,
author="Uptime Kuma CLI",
description="A command-line interface for Uptime Kuma",
long_description=long_description,