Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: runserver.spec

Issue 6236544096534528: Issue 2578 - Refactored and added missing hidden import (Closed)
Patch Set: Created May 22, 2015, 9:02 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« runserver.py ('K') | « runserver.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runserver.spec
===================================================================
--- a/runserver.spec
+++ b/runserver.spec
@@ -1,9 +1,29 @@
# PyInstaller spec, run "pyinstaller runserver.spec" from repository root to build
-a = Analysis(
- ['runserver.py'],
+# Hidden imports are supposed to be analyzed recursively. However, due to
+# a bug in PyInstaller imports from inside hidden modules aren't considered.
+# https://github.com/pyinstaller/pyinstaller/issues/1086
+def AnalysisWithHiddenImportsWorkaround(scripts, **kwargs):
Sebastian Noack 2015/05/22 21:19:27 Yeah, as the comment says, the hiddenimports passe
+ import os
+
+ filename = os.path.join(WORKPATH, '_hidden_imports.py')
+ with open(filename, 'wb') as file:
+ for module in kwargs.pop('hiddenimports'):
+ print >>file, 'import ' + module
+
+ a = Analysis([filename] + scripts, **kwargs)
+ 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
+ return a
+
+a = AnalysisWithHiddenImportsWorkaround(
+ ['cms/bin/test_server.py'],
pathex=['.'],
- hiddenimports=[],
+ hiddenimports=[
+ 'markdown.extensions.attr_list',
+
+ # Used by globals/get_browser_versions.py in web.adblockplus.org
+ 'xml.dom.minidom',
+ ],
excludes=[
'distutils',
'doctest',
« runserver.py ('K') | « runserver.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld