Left: | ||
Right: |
OLD | NEW |
---|---|
1 # PyInstaller spec, run "pyinstaller runserver.spec" from repository root to bui ld | 1 # PyInstaller spec, run "pyinstaller runserver.spec" from repository root to bui ld |
2 | 2 |
3 a = Analysis( | 3 # Hidden imports are supposed to be analyzed recursively. However, due to |
4 ['runserver.py'], | 4 # a bug in PyInstaller imports from inside hidden modules aren't considered. |
5 # https://github.com/pyinstaller/pyinstaller/issues/1086 | |
6 def AnalysisWithHiddenImportsWorkaround(scripts, **kwargs): | |
Sebastian Noack
2015/05/22 21:19:27
Yeah, as the comment says, the hiddenimports passe
| |
7 import os | |
8 | |
9 filename = os.path.join(WORKPATH, '_hidden_imports.py') | |
10 with open(filename, 'wb') as file: | |
11 for module in kwargs.pop('hiddenimports'): | |
12 print >>file, 'import ' + module | |
13 | |
14 a = Analysis([filename] + scripts, **kwargs) | |
15 a.scripts -= [('_hidden_imports', None, None)] | |
Wladimir Palant
2015/05/26 10:46:31
Shouldn't we remove _hidden_imports.py here?
Sebastian Noack
2015/05/26 11:13:57
The first element is the module name, not the file
Wladimir Palant
2015/05/26 11:24:43
And I mean the file - the one you created on disk,
Sebastian Noack
2015/05/26 11:37:39
Along with some other temporary files in the build
| |
16 return a | |
17 | |
18 a = AnalysisWithHiddenImportsWorkaround( | |
19 ['cms/bin/test_server.py'], | |
5 pathex=['.'], | 20 pathex=['.'], |
6 hiddenimports=[], | 21 hiddenimports=[ |
22 'markdown.extensions.attr_list', | |
23 | |
24 # Used by globals/get_browser_versions.py in web.adblockplus.org | |
25 'xml.dom.minidom', | |
26 ], | |
7 excludes=[ | 27 excludes=[ |
8 'distutils', | 28 'distutils', |
9 'doctest', | 29 'doctest', |
10 'ssl', | 30 'ssl', |
11 '_ssl', | 31 '_ssl', |
12 'werkzeug', | 32 'werkzeug', |
13 | 33 |
14 # Mac-specific | 34 # Mac-specific |
15 'Carbon', | 35 'Carbon', |
16 'Finder', | 36 'Finder', |
17 'StdSuites', | 37 'StdSuites', |
18 ], | 38 ], |
19 ) | 39 ) |
20 | 40 |
21 pyz = PYZ(a.pure) | 41 pyz = PYZ(a.pure) |
22 | 42 |
23 exe = EXE( | 43 exe = EXE( |
24 pyz, | 44 pyz, |
25 a.scripts, | 45 a.scripts, |
26 a.binaries, | 46 a.binaries, |
27 a.zipfiles, | 47 a.zipfiles, |
28 a.datas, | 48 a.datas, |
29 name='runserver', | 49 name='runserver', |
30 debug=False, | 50 debug=False, |
31 strip=None, | 51 strip=None, |
32 upx=False, | 52 upx=False, |
33 console=True | 53 console=True |
34 ) | 54 ) |
OLD | NEW |