I thought that hiddenimport behaviour is the same as if I had explicit import statement in my script?
Goebel Consult, Landshut
http://www.goebel-consult.de
Blog:
http://www.goebel-consult.de/blog/in-need-for-an-enhanced-git-url-scheme
Kolumne:
http://www.cissp-gefluester.de/2010-08-scheingefechte-um-rim
Goebel Consult ist Mitglied bei http://www.7-it.de/
def Entrypoint(dist, group, name, distributions,
scripts=None, pathex=None, hiddenimports=None,
hookspath=None, excludes=None, runtime_hooks=None):
import pkg_resources
def get_toplevel(dist):
distribution = pkg_resources.get_distribution(dist)
return list(distribution.get_metadata('top_level.txt').split())
packages = []
for distribution in distributions:
packages += get_toplevel(distribution)
scripts = scripts or []
pathex = pathex or []
# get the entry point
ep = pkg_resources.get_entry_info(dist, group, name)
# insert path of the egg at the verify front of the search path
pathex = [ep.dist.location] + pathex
# script name must not be a valid module name to avoid name clashes on import
script_path = os.path.join(WORKPATH, name + '-script.py')
print "creating script for entry point", dist, group, name
with open(script_path, 'w') as fh:
fh.write("import {0}\n".format(ep.module_name))
fh.write("{0}.{1}()\n".format(ep.module_name, '.'.join(ep.attrs)))
for package in packages:
fh.write("import {0}\n".format(package))
return Analysis([script_path] + scripts, pathex, hiddenimports, hookspath, excludes, runtime_hooks)
On Sunday 09 of November 2014 22:51:29 Michael Sverdlik wrote:
> Since we use the entry point hack
> <http://www.pyinstaller.org/wiki/Recipe/SetuptoolsEntryPoint>, I decided to
> extend it a bit and add code that will create a dummy file with explicit
> imports:
Hi Michael,
I moved the recipe to github and put there your example:
https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Setuptools-Entry-Point
Could you please update this wiki page if necessary?
Thanks
Martin