public
Last active

P | setupfile for py2exe

  • Download Gist
setup.py
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
from distutils.core import setup
import py2exe
import os
 
includes = []
includes.append('numpy')
includes.append('numpy.core')
includes.append('configobj')
includes.append('reportlab')
includes.append('reportlab.pdfbase')
includes.append('reportlab.pdfbase.*')
includes.append('scipy')
includes.append('xml')
includes.append('xml.etree')
includes.append('xml.etree.*')
 
includes.append('wx')
includes.append('wx.*')
 
includes.append('traits')
includes.append('traitsui')
includes.append('traitsui.editors')
includes.append('traitsui.editors.*')
includes.append('traitsui.extras')
includes.append('traitsui.extras.*')
includes.append('traitsui.image')
includes.append('traitsui.image.*')
includes.append('traitsui.ui_traits')
 
includes.append('traits.api')
includes.append('traits.*')
 
includes.append('traitsui.wx')
includes.append('traitsui.wx.*')
includes.append('chaco.*')
 
includes.append('kiva')
 
includes.append('pyface')
includes.append('pyface.*')
includes.append('pyface.wx')
includes.append('pyface.toolkit')
includes.append('pyface.image_resource')
includes.append('pyface.image_resource.*')
 
includes.append('pyface.ui.wx')
includes.append('pyface.ui.wx.init')
includes.append('pyface.ui.wx.*')
includes.append('pyface.ui.wx.grid.*')
includes.append('pyface.ui.wx.action.*')
includes.append('pyface.ui.wx.timer.*')
includes.append('pyface.ui.wx.wizard.*')
includes.append('pyface.ui.wx.workbench.*')
 
includes.append('enable')
includes.append('enable.drawing')
includes.append('enable.tools')
includes.append('enable.wx')
includes.append('enable.wx.*')
 
includes.append('enable.savage')
includes.append('enable.savage.*')
includes.append('enable.savage.svg')
includes.append('enable.savage.svg.*')
includes.append('enable.savage.svg.backends')
includes.append('enable.savage.svg.backends.wx')
includes.append('enable.savage.svg.backends.wx.*')
includes.append('enable.savage.svg.css')
includes.append('enable.savage.compliance')
includes.append('enable.savage.trait_defs')
includes.append('enable.savage.trait_defs.*')
includes.append('enable.savage.trait_defs.ui')
includes.append('enable.savage.trait_defs.ui.*')
includes.append('enable.savage.trait_defs.ui.wx')
includes.append('enable.savage.trait_defs.ui.wx.*')
 
packages = []
 
data_folders = []
 
# Traited apps:
ETS_folder = r'C:\Python27\Lib\site-packages'
 
data_folders.append((os.path.join(ETS_folder, r'enable\images'), r'enable/images'))
data_folders.append((os.path.join(ETS_folder, r'pyface\images'), r'pyface\images'))
data_folders.append((os.path.join(ETS_folder, r'pyface\ui\wx\images'), r'pyface\ui\wx\images'))
data_folders.append((os.path.join(ETS_folder, r'pyface\ui\wx\grid\images'), r'pyface\ui\wx\grid\images'))
 
data_folders.append((os.path.join(ETS_folder, r'traitsui\wx\images'), r'traitsui\wx\images'))
 
data_folders.append((os.path.join(ETS_folder, r'traitsui\image\library'), r'traitsui\image\library'))
 
data_folders.append((os.path.join(ETS_folder, r'enable\savage\trait_defs\ui\wx\data'), r'enable\savage\trait_defs\ui\wx\data'))
 
 
# Matplotlib
import matplotlib as mpl
data_files = mpl.get_py2exe_datafiles()
 
# Parsing folders and building the data_files table
for folder, relative_path in data_folders:
for file in os.listdir(folder):
f1 = os.path.join(folder, file)
if os.path.isfile(f1): # skip directories
f2 = relative_path, [f1]
data_files.append(f2)
 
data_files.append((r'enable', [os.path.join(ETS_folder, r'enable\images.zip')]))
 
setup(windows=['main.py'],
author="KR2",
version="0.1",
description="TouchIT log visu",
name="TouchIT log",
options={"py2exe": {"optimize": 0,
"packages": packages,
"includes": includes,
"dist_dir": 'dist',
"bundle_files": 2,
"xref": False,
"skip_archive": True,
"ascii": False,
"custom_boot_script": '',
"compressed": False,
"dll_excludes": ['libzmq.dll']
}, },
data_files=data_files)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.