diff --git a/setup.py b/setup.py index d6b303fba73..755c68b9199 100755 --- a/setup.py +++ b/setup.py @@ -22,6 +22,12 @@ from distutils.command.clean import clean from distutils.command.sdist import sdist # pylint: enable=E0611 +try: + import zmq + HAS_ZMQ = True +except ImportError: + HAS_ZMQ = False + # Change to salt source's directory prior to running any command try: SETUP_DIRNAME = os.path.dirname(__file__) @@ -517,6 +523,13 @@ FREEZER_INCLUDES = [ 'email.mime.*', ] +if HAS_ZMQ and zmq.pyzmq_version_info() >= (0, 14): + # We're freezing, and when freezing ZMQ needs to be installed, so this + # works fine + if 'zmq.core.*' in FREEZER_INCLUDES: + # For PyZMQ >= 0.14, freezing does not need 'zmq.core.*' + FREEZER_INCLUDES.remove('zmq.core.*') + if IS_WINDOWS_PLATFORM: FREEZER_INCLUDES.extend([ 'win32api',