Skip to content
This repository has been archived by the owner on Feb 25, 2018. It is now read-only.

Setup file Options

ali-r edited this page Oct 8, 2017 · 34 revisions

Setup file Options

Please see the tutorial for some working examples

In general this should be enough to get you started:

from esky import bdist_esky
from distutils.core import setup
setup(    
    name='somename',
    version='0.1',    
    scripts=['ascript.py'])

Esky is able to detect the freezer you have installed and automatically use that. To explicitly use a freezer:

setup(
    options = {"bdist_esky": {
                "freezer_module":"cxfreeze"
...
)

For py2exe you will still need to do import py2exe

Hiding the console window and adding icons

from esky.bdist_esky import Executable  
executables = [Executable('ham.py', icon='spam.ico', gui_only=True)]
setup(
    scripts = executables
    ...)

Getting More Info

To see all our options: in your setup file make sure you have from esky import bdist_esky

python setup.py bdist_esky --help
python setup.py  bdist_esky_patch --help

Esky lets you pass options through to your underlying freezer. (Most are tested but it could be possible a few don't work, let us know via an issue if you experience this)

For reference

Notable Esky Options

Including data files in Esky

setup(name="MyApp",
    data_files=[('', ['MyApp.xib']),
                ('files', ['file1', 'file2']),
                ('img', glob(r'.\img\*.*'))
               ]
    ...
    )

Excluding Packages

setup(
    options = { "bdist_esky": {'excludes':['tkinter', 'sys']}},
    ...)

Including Packages

setup(
    options = { "bdist_esky": {'includes':['tkinter', 'sys']}},
    ...)

Compression options for the zip - useful when testing as zipping takes time :(

setup(
    options={"bdist_esky": {"compress": "ZIP"}},
    ...)

All Options for bdist_esky command

option name description
dist_dir (-d) directory to put final built distributions in
freezer_module module to use for freezing the application
freezer_options options to pass to the underlying freezer module
bootstrap_module module to use for bootstrapping the application
bootstrap_code code to use for bootstrapping the application
compile_bootstrap_exes whether to compile the bootstrapping exes with pypy
bundle-msvcrt whether to bundle MSVCRT as private assembly
includes list of modules to specifically include
excludes list of modules to specifically exclude
dont_run_startup_hooks don't force execution of esky.run_startup_hooks()
pre_freeze_callback func to call just before starting to freeze the app
pre_zip_callback func to call just before starting to zip up the app
detached_bootstrap_library By default Esky appends the library.zip to the bootstrap executable when using CX_Freeze, this will tell esky to not do that, but create a separate library.zip instead
compress (-c) Compression options of the Esky, use lower case for compressed or upper case for uncompressed, currently only support zip files so do ZIP, zip or None

All Options for bdist_esky_patch command

option name description
dist_dir (-d) directory to put final built distributions in
from-version version against which to produce patch