Message133094
All right. The ultimate solution:
{{{
# Imports for converting version to MSI format for bdist_msi
from distutils.command.bdist_msi import bdist_msi
import inspect
import types
...
class bdist_msi_patch_version(bdist_msi):
""" MSI builder requires version to be in the x.x.x format """
def run(self):
def monkey_get_version(self):
""" monkey patch replacement for metadata.get_version() that
returns MSI compatible version string for bdist_msi
"""
# get filename of the calling function
if inspect.stack()[1][1].endswith('bdist_msi.py'):
# strip revision from version (if any), e.g. 11.0.0-r31546
return self.version.split('-')[0]
else:
return self.version
# monkeypatching get_version() call for DistributionMetadata
self.distribution.metadata.get_version = \
types.MethodType(monkey_get_version, self.distribution.metadata)
bdist_msi.run(self)
...
setup(
...
cmdclass={'bdist_msi': bdist_msi_version_hack},
)
}}} |
|
Date |
User |
Action |
Args |
2011-04-05 21:39:40 | techtonik | set | recipients:
+ techtonik, loewis, tim.golden, tarek, cdavid, eric.araujo, rogerbinns |
2011-04-05 21:39:40 | techtonik | set | messageid: <1302039580.52.0.258371864759.issue6040@psf.upfronthosting.co.za> |
2011-04-05 21:39:38 | techtonik | link | issue6040 messages |
2011-04-05 21:39:38 | techtonik | create | |
|