← Back to team overview

configglue team mailing list archive

[Merge] lp:~ricardokirkner/configglue/setup-version into lp:configglue

 

Ricardo Kirkner has proposed merging lp:~ricardokirkner/configglue/setup-version into lp:configglue.

Requested reviews:
  Configglue developers (configglue)

For more details, see:
https://code.launchpad.net/~ricardokirkner/configglue/setup-version/+merge/44741

Added idiom to place version number in code for introspection, while still using the same value in setup.py
-- 
https://code.launchpad.net/~ricardokirkner/configglue/setup-version/+merge/44741
Your team Configglue developers is requested to review the proposed merge of lp:~ricardokirkner/configglue/setup-version into lp:configglue.
=== modified file 'configglue/__init__.py'
--- configglue/__init__.py	2010-07-31 01:15:59 +0000
+++ configglue/__init__.py	2010-12-27 15:23:56 +0000
@@ -15,3 +15,4 @@
 # 
 ###############################################################################
 
+__version__ = '0.9.1'

=== modified file 'setup.py'
--- setup.py	2010-12-18 21:27:35 +0000
+++ setup.py	2010-12-27 15:23:56 +0000
@@ -16,13 +16,25 @@
 ###############################################################################
 
 
-from setuptools import setup, find_packages
-import sys, os
-
-version = '0.9pre1'
+import os
+import sys
+from setuptools import (
+    find_packages,
+    setup,
+)
+
+
+def get_version():
+    version = [
+        (line.split('=')[1]).strip().strip('"').strip("'")
+        for line in open(os.path.join('configglue', '__init__.py'))
+        if line.startswith( '__version__' )
+    ][0]
+    return version
+
 
 setup(name='configglue',
-      version=version,
+      version=get_version(),
       description="Glue to stick OptionParser and ConfigParser together",
       long_description="""
 configglue is a library that glues together python's optparse.OptionParser and
@@ -44,4 +56,4 @@
       zip_safe=True,
       test_suite='tests',
       tests_require=['mock'],
-      )
+)


Follow ups