Hi,
(This is to record my approach to solve the problem)
After pondering for days, I decided to use the (1) scheme I mentioned:
(1) Create a phony import to use hook-<module> scheme
I created a completely empty module (ex. A.py) and added an import to
the toplevel module.
Then I created hook file (hook-A.py) and listed all hidden imports (I
found many).
Listed modules are considered when PyInstaller tries to import A.py.
(It is a well crafted mechanism, I would say.)
Of course, this hook file may need to be changed if I try to execute a
different script.
But that is not a problem for now as I know which script to be
executed.
I resisted adding a completely empty file to my project but I
concluded that (1) is better than other alternatives.
I also found that analyzer.modules is the database that holds
collected modules. Therefore, you can manipulate it to add modules
directly.
Aki-