dbv píše v St 20. 03. 2013 v 16:23 -0700:
> What is the best practice for finding modules to satisfy hidden
> imports?

Could you please specify what you mean by 'hidden imports'?
- imports that pyinstaller is not able find by default or
- all imports that pyinstaller is able to find? 

> Spent time understanding mf.py only to find out it is no longer
> available in pyinstaller.

There is no longer available file mf.py. However, its code is still
present there. The code and file structure was just refactored.

The mf.py code is mostly in ./PyInstaller/depend/imptracker.py.

> The ideal solution is to pass all the source files to the module
> finder which then outputs the necessary hidden imports.

The ideal solution would be to use python library 'modulegraph' for
module dependency analysis. Modulegraph works the way you described: You
pass all source modules to modulegraph which then outputs the necessary
imports.

- For python3 support I would like to use modulegraph for import
analysis.
- I started some work on it in ./PyInstaller/depend/build.py. Look for
function 'assemble_modulegraph' in that file.

There will be always some cases where pyinstaller will not be able to
find proper import dependencies and for these cases
- there are import hooks
- some other heuristic would be necessary

One example, where it is hard to detect dependencies are Python C/C++
extensions.
- one heuristic in that case could be to import C extension in a python
subprocess and get the difference of 'sys.modules.keys()' before and
after import.

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to