Commits

Jason R. Coombs  committed 56d1341

Version number now extracted from the library, so it only needs to updated in two places instead of three.

  • Participants
  • Parent commits 1335221
  • Branches jaraco.httplib2

Comments (0)

Files changed (1)

 except ImportError:
     from distutils.core import setup
 import sys
+import re
 
 package_dir = {'jaraco.httplib2': 'python%s/httplib2' % sys.version_info[0]}
-VERSION = '0.7.2'
+
+def get_version(filename):
+    pattern = re.compile("""__version__\s*=\s*['"](.*?)['"]""")
+    file = open(filename)
+    content = file.read()
+    version = pattern.search(content).group(1)
+    return version
+
+PY2VER = get_version('python2/httplib2/__init__.py')
+PY3VER = get_version('python3/httplib2/__init__.py')
+assert PY2VER == PY3VER, "Versions must match for Python2/Python3"
 
 setup(name='jaraco.httplib2',
-        version=VERSION,
+        version=PY2VER,
         author='Joe Gregorio',
         author_email='joe@bitworking.org',
         maintainer='Jason R. Coombs',