Mercurial > python-hglib
diff setup.py @ 162:e0678dfb7aec 1.7
setup: parse PKG-INFO for version information (issue3924)
author | Peter Elmers <peter.elmers@yahoo.com> |
---|---|
date | Thu, 23 Jul 2015 09:18:01 -0700 |
parents | 91329df47df5 |
children | d06b48001662 |
line wrap: on
line diff
--- a/setup.py Wed Apr 01 13:34:58 2015 -0500 +++ b/setup.py Thu Jul 23 09:18:01 2015 -0700 @@ -1,7 +1,7 @@ import os, time from distutils.core import setup -# query Mercurial for version number +# query Mercurial for version number, or pull from PKG-INFO version = 'unknown' if os.path.isdir('.hg'): cmd = "hg id -i -t" @@ -26,6 +26,10 @@ version = '%(latesttag)s+%(latesttagdistance)s-%(node).12s' % kw else: version = kw.get('node', '')[:12] +elif os.path.exists('PKG-INFO'): + kw = dict([[t.strip() for t in l.split(':', 1)] + for l in open('PKG-INFO') if ':' in l]) + version = kw.get('Version', version) setup( name='python-hglib',