# HG changeset patch # User Joerg Sonnenberger # Date 1618943746 -7200 # Node ID 8d2b62d716b095507effaa8d56f87cd27ba659ab # Parent 01264552a1dc163161a334c2568f3a68bf06e355 packaging: extract pre-computed version when running from plain tarball The tarballs created by setup.py are not including the usual archive markers that `hg archive` leaves, so the rewrite of the version number computation actually left the empty version string around. This meant that installations from PyPI would use 0.0.0 as version string. Differential Revision: https://phab.mercurial-scm.org/D10502 diff -r 01264552a1dc -r 8d2b62d716b0 setup.py --- a/setup.py Tue Apr 20 11:12:20 2021 -0400 +++ b/setup.py Tue Apr 20 20:35:46 2021 +0200 @@ -437,6 +437,9 @@ version = '%(latesttag)s+hg%(latesttagdistance)s.%(node).12s' % kw else: version = '0+hg' + kw.get('node', '')[:12] +elif os.path.exists('mercurial/__version__.py'): + data = open('mercurial/__version__.py').read() + version = re.search('version = b"(.*)"', data).group(1) if version: versionb = version