Add bdist_esky command to setup.py

* Add bdist_esky command through import from esky
* Add list of explicit includes with platform detection
* Update salt build to be zip unsafe
This commit is contained in:
Aaron Tygart 2012-09-10 13:27:40 -05:00
parent 94829774d8
commit 98d8ed8723

View file

@ -128,8 +128,50 @@ setup_kwargs = {'name': NAME,
('share/man/man7', ['doc/man/salt.7']),
],
'install_requires': requirements,
# The dynamic module loading in salt.modules makes this
# package zip unsafe.
'zip_safe': False
}
# bbfreeze explicit includes
# Sometimes the auto module traversal doesn't find everything, so we
# explicitly add it. The auto dependency tracking especially does not work for
# imports occurring in salt.modules, as they are loaded at salt runtime.
# Specifying includes that don't exist doesn't appear to cause a freezing
# error.
freezer_includes = [
'zmq.core.*',
'zmq.utils.*',
'ast',
]
if sys.platform == 'win32':
freezer_includes.extend([
'win32con',
'win32security',
'ntsecuritycon'
])
elif sys.platform.startswith('linux'):
freezer_includes.extend([
'yum'
])
if 'bdist_esky' in sys.argv:
# Add the esky bdist target if the module is available
# may require additional modules depending on platform
from esky import bdist_esky
# bbfreeze chosen for its tight integration with distutils
import bbfreeze
options = setup_kwargs.get('options', {})
options['bdist_esky'] = {
"freezer_module": "bbfreeze",
"freezer_options": {
"includes": freezer_includes
}
}
setup_kwargs['options'] = options
if with_setuptools:
setup_kwargs['entry_points'] = {
"console_scripts": ["salt-master = salt.scripts:salt_master",