Skip to content

Commit

Permalink
pyinstaller: added hook script for the future module
Browse files Browse the repository at this point in the history
* added debug option for windows builds that prints to console
  • Loading branch information
robmcmullen committed Sep 2, 2017
1 parent 220730e commit 38c5673
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
9 changes: 6 additions & 3 deletions pyinstaller/OmnivoreXL.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- mode: python -*-

block_cipher = None
DEBUG = False

with open("../run.py", "r") as fh:
script = fh.read()
Expand Down Expand Up @@ -54,16 +55,18 @@ if sys.platform == "darwin":
icon=icon)

elif sys.platform == "win32":
upx = not DEBUG
console = DEBUG
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='OmnivoreXL',
debug=False,
debug=DEBUG,
strip=False,
upx=True,
console=False,
upx=upx,
console=console,
icon="../omnivore/icons/omnivore.ico")


12 changes: 9 additions & 3 deletions pyinstaller/build_pyinstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
from subprocess import Popen, PIPE

if sys.platform == 'win32':
# On windows, you can disable installation of egg files by creating the
# file %HOMEPATH%/pydistutils.cfg
#
# pyinstaller 3.2 doesn't work with the 'future' library. Development
# branch was suggested because of a fix for:
# https://github.com/pyinstaller/pyinstaller/issues/1935 but it still
# doesn't work. There are dynamic imports that aren't being included, so I
# had to create hook-future.py to include those.
win = True
mac = False
exe = ".exe"
Expand Down Expand Up @@ -45,9 +53,7 @@ def run(args):
dest_zip = "%s/%s" % (dest_dir, final_zip)

print "Building %s" % build_app
args = ['pyinstaller', '-y', '--debug', '--windowed']
if win:
args.append('--onefile')
args = ['pyinstaller', '-y']
args.append('%s.spec' % build_target)
run(args)

Expand Down
7 changes: 7 additions & 0 deletions pyinstaller/hook-future.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python
"""
Future has some dynamic imports that are not picked up
"""

hiddenimports = ['UserList', 'UserDict', 'UserString', 'itertools', 'stat', 'base64', 'commands']

0 comments on commit 38c5673

Please sign in to comment.