From a5aa752a857bfaa53e97dc39182bb354509450be Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 14 Aug 2015 15:27:03 +0100 Subject: [PATCH] Override the develop command when WITH_SETUPTOOLS is set --- setup.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index a530eda3411..653fef01d9e 100755 --- a/setup.py +++ b/setup.py @@ -71,6 +71,7 @@ WITH_SETUPTOOLS = False if 'USE_SETUPTOOLS' in os.environ or 'setuptools' in sys.modules: try: from setuptools import setup + from setuptools.command.develop import develop from setuptools.command.install import install from setuptools.command.sdist import sdist from setuptools.command.egg_info import egg_info @@ -190,6 +191,17 @@ class WriteSaltSshPackagingFile(Command): # pylint: enable=E0602 +if WITH_SETUPTOOLS: + class Develop(develop): + def run(self): + if IS_WINDOWS_PLATFORM: + # Install M2Crypto first + self.distribution.salt_installing_m2crypto_windows = True + self.run_command('install-m2crypto-windows') + self.distribution.salt_installing_m2crypto_windows = None + develop.run(self) + + class InstallM2CryptoWindows(Command): description = 'Install M2CryptoWindows' @@ -649,8 +661,9 @@ class SaltDistribution(distutils.dist.Distribution): 'write-salt-ssh-packaging-file': WriteSaltSshPackaingFile}) if not IS_WINDOWS_PLATFORM: self.cmdclass.update({'sdist': CloudSdist, - 'install_lib': InstallLib - 'install-m2crypto-windows': InstallM2CryptoWindows}) + 'install_lib': InstallLib}) + if IS_WINDOWS_PLATFORM: + self.cmdclass.update({'install-m2crypto-windows': InstallM2CryptoWindows}) self.license = 'Apache Software License 2.0' self.packages = self.discover_packages()