setup: explain to distutils how we write rc versions stable
author"Paul Morelle <paul.morelle@octobus.net"
Wed, 31 Oct 2018 20:32:42 +0100
branchstable
changeset 40446 b6bc2293cdf3
parent 40445 634b45317459
child 40447 f1c1b4d0e695
setup: explain to distutils how we write rc versions When we use a rc version number (e.g. 4.8rc0), bdist_msi is using distutils.StrictVersion to parse it into a tuple of numbers. By default, StrictVersion.version_re only recognizes [ab] for alpha/beta, where mercurial may use '-rc' or 'rc'. This change makes StrictVersion parse correctly our version numbers, so that bdist_msi doesn't fail on rc versions.
setup.py
--- a/setup.py	Wed Oct 31 12:08:37 2018 -0700
+++ b/setup.py	Wed Oct 31 20:32:42 2018 +0100
@@ -168,6 +168,9 @@
 from distutils.sysconfig import get_python_inc, get_config_var
 from distutils.version import StrictVersion
 
+# Explain to distutils.StrictVersion how our release candidates are versionned
+StrictVersion.version_re = re.compile(r'^(\d+)\.(\d+)(\.(\d+))?-?(rc(\d+))?$')
+
 def write_if_changed(path, content):
     """Write content to a file iff the content hasn't changed."""
     if os.path.exists(path):