From cf6c724575951c89e10d999a31002d967f396d8c Mon Sep 17 00:00:00 2001 From: David Vierra Date: Sun, 29 Mar 2015 07:16:44 -1000 Subject: [PATCH] Exclude some IPython assets and modules from ipy spec. Finally exclude Tkinter for real. --- mcedit2.spec | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/mcedit2.spec b/mcedit2.spec index aef401a..d87524a 100644 --- a/mcedit2.spec +++ b/mcedit2.spec @@ -6,7 +6,12 @@ a = Analysis(['src/mcedit2/main.py'], hiddenimports=['PySide.QtXml', 'zmq'], hookspath=['.'], runtime_hooks=None, - excludes=['tkinter', 'tcl', 'tk', 'wx'] + excludes=['Tkinter', 'Tcl', 'Tk', 'wx', + 'IPython.sphinxext', 'IPython.nbconvert', + 'IPython.lib.editorhooks', 'IPython.core.tests', + 'IPython.extensions.cythonmagic', + 'jinja2', + ] ) # Suppress pyconfig.h warning @@ -27,6 +32,21 @@ pyz = PYZ(a.pure) onefile = True +# Remove IPython html assets, saving 1.5MB. +# Disables using the embedded IPython for notebooks +# Anyone who wants this can run from source! +def ipy_filter(filename): + return not ( + filename.startswith("IPython\\html") or + filename.startswith("IPython\\nbconvert") or + filename.startswith("IPython\\nbformat") or + filename.startswith("IPython\\testing") + ) + +a.datas = [(filename, path, filetype) + for filename, path, filetype in a.datas + if ipy_filter(filename)] + if onefile: a.scripts += a.binaries + a.zipfiles + a.datas @@ -36,7 +56,7 @@ exe = EXE(pyz, name='mcedit2.exe', debug=False, strip=None, - upx=True, + upx=False, console=True, icon="mcediticon.ico")