Skip to content

Commit 240e594

Browse files
Merge pull request #17 from GarettSoftware/dev
Revert project_metadata loading
2 parents b016f12 + 7eb0859 commit 240e594

3 files changed

Lines changed: 20 additions & 14 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ docs/build
2424

2525
# Build
2626
dist
27+
build
2728

2829
# Release
2930
logseg.egg-info

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools>=42", "wheel"]
3+
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1+
import os
2+
13
from setuptools import setup, find_packages
24

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)
1214

1315
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"),
1921
author_email="garettsoftware@gmail.com",
2022
license="MIT",
2123
packages=find_packages(exclude=["tests", "tests.*"]),

0 commit comments

Comments
 (0)