-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
70 lines (62 loc) · 2.18 KB
/
setup.py
File metadata and controls
70 lines (62 loc) · 2.18 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
from setuptools import setup, find_packages
# Read the long description from README.md
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
# Read the requirements from requirements.txt
with open("requirements.txt", "r", encoding="utf-8") as f:
requirements = f.read().splitlines()
# Read version dynamically (same system as package)
def get_version():
"""Get version using the same dynamic system as the package."""
import os
import subprocess
from pathlib import Path
# Get current directory (setup.py location)
current_dir = Path.cwd()
# Try git tags first (single source of truth)
try:
result = subprocess.run(
['git', 'describe', '--tags', '--abbrev=0'],
cwd=current_dir,
capture_output=True,
text=True,
check=True
)
return result.stdout.strip().lstrip('v')
except (subprocess.CalledProcessError, FileNotFoundError):
pass
# Try environment variable
version = os.getenv('VERSION')
if version:
return version.lstrip('v')
# Fallback version (must match package fallback)
return "1.1.15"
setup(
name="route-planner",
version=get_version(),
author="Route Planner Development Team",
author_email="your.email@example.com",
description="A PyQt5-based delivery route optimization application",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/yammanhammad/Route_Planner",
packages=find_packages(),
include_package_data=True,
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Intended Audience :: End Users/Desktop",
"Topic :: Office/Business :: Scheduling",
],
python_requires=">=3.8",
install_requires=requirements,
entry_points={
"console_scripts": [
"route-planner=route_planner.core:main",
],
},
)