Mercurial > hg-stable
changeset 40420:b6bc2293cdf3 stable
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.
author | "Paul Morelle <paul.morelle@octobus.net" |
---|---|
date | Wed, 31 Oct 2018 20:32:42 +0100 |
parents | 634b45317459 |
children | f1c1b4d0e695 |
files | setup.py |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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):