-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.py
More file actions
50 lines (44 loc) · 1.64 KB
/
setup.py
File metadata and controls
50 lines (44 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from pathlib import Path
from setuptools import setup, find_packages
from setuptools.command.sdist import sdist as _sdist
from setuptools.command.bdist_wheel import bdist_wheel as _bdist_wheel
import subprocess
BASE_DIR = Path(__file__).resolve().parent
VERSION_FILE = BASE_DIR / "VERSION"
def read_requirements():
req_file = BASE_DIR / "requirements.txt"
return req_file.read_text().splitlines() if req_file.exists() else []
def read_readme():
readme_file = BASE_DIR / "README.md"
return readme_file.read_text(encoding="utf-8") if readme_file.exists() else ""
def get_version():
"""Get the version from Git tags or the VERSION file."""
try:
# Get the latest Git tag
version = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"], stderr=subprocess.DEVNULL).decode().strip()
return version
except subprocess.CalledProcessError:
return "6.0.0" # Default version if all else fails
setup(
name="liberty-framework",
version=get_version(),
description="Liberty Framework",
author="Franck Blettner",
author_email="franck.blettner@nomana-it.fr",
packages=find_packages(),
long_description=read_readme(),
long_description_content_type="text/markdown",
include_package_data=True,
install_requires=read_requirements(),
entry_points={
"console_scripts": [
"liberty-start=liberty.framework.main:main", # Creates a CLI command to start the app
]
},
classifiers=[
"Programming Language :: Python :: 3",
"Framework :: FastAPI",
"Operating System :: OS Independent",
],
python_requires=">=3.8"
)