Add kumacli version and link it into setup.py
This commit is contained in:
16
setup.py
16
setup.py
@@ -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,
|
||||
|
Reference in New Issue
Block a user