summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorJason Madden <jamadden@gmail.com>2020-11-16 10:23:12 -0600
committerJason Madden <jamadden@gmail.com>2020-11-16 10:26:12 -0600
commit492f69bd6048e1d20ca6867906e4bc447f61d2a8 (patch)
treebf1e20a5bfadf548cdc05ecd55adaf3fef5ed86c /setup.py
parentf6c279328f81c6878d7c1c49b9bb8dffe1c70fb9 (diff)
downloadgreenlet-492f69bd6048e1d20ca6867906e4bc447f61d2a8.tar.gz
Move definition of __version__ into __init__.py.
Instead of getting it from C in the GREENLET_VERSION macro. Also read this value in setup.py. This gets us DRY (don't repeat yourself) and compatibility with tools like zest.releaser.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index e5947ed..6cd3199 100755
--- a/setup.py
+++ b/setup.py
@@ -94,9 +94,20 @@ else:
include_dirs=[GREENLET_HEADER_DIR]),
)
+
+def get_greenlet_version():
+ with open('src/greenlet/__init__.py') as f:
+ looking_for = '__version__ = \''
+ for line in f:
+ if line.startswith(looking_for):
+ version = line[len(looking_for):-2]
+ return version
+ raise ValueError("Unable to find version")
+
+
setup(
name="greenlet",
- version='1.0.0.dev0',
+ version=get_greenlet_version(),
description='Lightweight in-process concurrent programming',
long_description=readfile("README.rst"),
long_description_content_type="text/x-rst",