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.
--- 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):