[issue6040] bdist_msi does not deal with pre-release version

anatoly techtonik report at bugs.python.org
Tue Apr 5 16:45:40 CEST 2011


anatoly techtonik <techtonik at gmail.com> added the comment:

Metadata can be automatically figured out using regexp matching like ^\d+(\.\d+){2,3}, but for explicit handling there should be should some callback or msi-specific version property in metadata. In the end it is pretty logical if binary distribution process can be configured using distribution specific (bdist_* specific) properties.

In the meanwhile here is the workaround:
{{{

from distutils.command.bdist_msi import bdist_msi

class bdist_msi_version_hack(bdist_msi):
    """ bdist_msi requires version to be in x.x.x format
        because it is embedded into MSI
    """
    def run(self):
        # strip suffix from version, i.e. from 11.0.0+r3443
        saved = self.distribution.metadata.version
        self.distribution.metadata.version = saved.split('+')[0]
        bdist_msi.run(self)
        saved_version = self.distribution.metadata.version

setup(
    ...
    cmdclass={'bdist_msi': bdist_msi_version_hack},
)
}}}

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6040>
_______________________________________


More information about the Python-bugs-list mailing list