|
| 1 | +import os |
| 2 | + |
1 | 3 | from setuptools import setup, find_packages |
2 | 4 |
|
3 | | -# Define metadata directly in setup.py to avoid circular import issues |
4 | | -NAME = "logseg" |
5 | | -VERSION = "0.3.0" |
6 | | -AUTHOR = "Garett MacGowan" |
7 | | -DESCRIPTION = "Python logging for multi-process and multi-threaded applications." |
8 | | -LONG_DESCRIPTION = ( |
9 | | - "Multiprocessing focused Python logger with easy-to-use log file segmentation for a better multiprocessing logging " |
10 | | - "experience." |
11 | | -) |
| 5 | +# Define an empty dictionary to store the extracted constants |
| 6 | +metadata = {} |
| 7 | + |
| 8 | +# Create the full path to 'project_metadata.py' |
| 9 | +metadata_file_path = os.path.join(os.getcwd(), 'logseg/project_metadata.py') |
| 10 | + |
| 11 | +# Execute the 'project_metadata.py' file and capture the defined constants |
| 12 | +with open(metadata_file_path) as metadata_file: |
| 13 | + exec(compile(metadata_file.read(), metadata_file_path, 'exec'), metadata) |
12 | 14 |
|
13 | 15 | setup( |
14 | | - name=NAME, |
15 | | - version=VERSION, |
16 | | - description=DESCRIPTION, |
17 | | - long_description=LONG_DESCRIPTION, |
18 | | - author=AUTHOR, |
| 16 | + name=metadata.get("NAME"), |
| 17 | + version=metadata.get("VERSION"), |
| 18 | + description=metadata.get("DESCRIPTION"), |
| 19 | + long_description=metadata.get("LONG_DESCRIPTION"), |
| 20 | + author=metadata.get("AUTHOR"), |
19 | 21 | author_email="garettsoftware@gmail.com", |
20 | 22 | license="MIT", |
21 | 23 | packages=find_packages(exclude=["tests", "tests.*"]), |
|
0 commit comments