-
Notifications
You must be signed in to change notification settings - Fork 4
/
pyinstaller-darwin.spec
65 lines (60 loc) · 2.85 KB
/
pyinstaller-darwin.spec
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
# -*- mode: python -*-
# =============================================================================
# @file pyinstaller-darwin.spec
# @brief Spec file for PyInstaller for macOS
# @author Michael Hucka
# @license Please see the file named LICENSE in the project directory
# @website https://github.com/mhucka/zowie
# =============================================================================
import imp
import os
from PyInstaller.utils.hooks import copy_metadata
import sys
# The data_files setting below following fixes this run-time error:
#
# File "humanize/__init__.py", line 14, in <module>
# File "pkg_resources/__init__.py", line 465, in get_distribution
# File "pkg_resources/__init__.py", line 341, in get_provider
# File "pkg_resources/__init__.py", line 884, in require
# File "pkg_resources/__init__.py", line 770, in resolve
# pkg_resources.DistributionNotFound: The 'humanize' distribution was
# not found and is required by the application
#
# I don't actually know why that error occurs. CommonPy imports humanize,
# and it has it in its requirements.txt, and PyInstaller looks like it's
# picking it up. So I'm stumped about why humanize seems to get missed in
# the binary produced by PyInstaller. Don't have time to debug more.
data_files = copy_metadata('humanize')
configuration = Analysis(['zowie/__main__.py'],
pathex = ['.'],
binaries = [],
datas = data_files,
hiddenimports = ['keyring.backends',
'keyring.backends.OS_X'],
hookspath = [],
runtime_hooks = [],
# For reasons I can't figure out, PyInstaller tries
# to load these even though they're never imported
# by the Zowie code. Have to exclude them manually.
excludes = ['PyQt4', 'PyQt5', 'gtk', 'matplotlib',
'numpy'],
win_no_prefer_redirects = False,
win_private_assemblies = False,
cipher = None,
)
application_pyz = PYZ(configuration.pure,
configuration.zipped_data,
cipher = None,
)
executable = EXE(application_pyz,
configuration.scripts,
configuration.binaries,
configuration.zipfiles,
configuration.datas,
name = 'zowie',
debug = False,
strip = True,
upx = False,
runtime_tmpdir = None,
console = False,
)