|
5 | 5 | Traditional setup.py configuration for reliable PyPI packaging. |
6 | 6 | """ |
7 | 7 |
|
8 | | -from setuptools import setup, find_packages |
| 8 | +from setuptools import setup |
9 | 9 | import os |
10 | | -import sys |
| 10 | +import re |
11 | 11 |
|
12 | | -# Add the package directory to path to import version |
13 | | -sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'taskvine_report')) |
14 | | -from taskvine_report import __version__ |
| 12 | +def get_version(): |
| 13 | + """Read version from __init__.py without importing the package""" |
| 14 | + init_path = os.path.join(os.path.dirname(__file__), 'taskvine_report', '__init__.py') |
| 15 | + with open(init_path, 'r', encoding='utf-8') as f: |
| 16 | + content = f.read() |
| 17 | + version_match = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', content, re.M) |
| 18 | + if version_match: |
| 19 | + return version_match.group(1) |
| 20 | + raise RuntimeError('Unable to find version string.') |
15 | 21 |
|
16 | 22 | with open("README.md", "r", encoding="utf-8") as fh: |
17 | 23 | long_description = fh.read() |
18 | 24 |
|
19 | 25 | setup( |
20 | 26 | name="taskvine-report-tool", |
21 | | - version=__version__, |
| 27 | + version=get_version(), |
22 | 28 | author="Collaborative Computing Lab (CCL), University of Notre Dame", |
23 | 29 | |
24 | 30 | description="Visualization and analysis tool for TaskVine execution logs", |
|
47 | 53 | "Topic :: System :: Distributed Computing", |
48 | 54 | "Topic :: System :: Monitoring", |
49 | 55 | ], |
50 | | - python_requires=">=3.7", |
| 56 | + python_requires=">=3.7,<3.12", |
51 | 57 | install_requires=[ |
52 | 58 | "flask>=2.0.0", |
53 | 59 | "pandas>=1.3.0", |
|
0 commit comments