Closed Legorooj closed 4 years ago
Update: I ran this with vanilla modulegraph2, and after removing a type hint which imported PyInstaller(?) I managed to reproduce this using the exact command set in a fresh virtual environment. (Replacing PyInstaller.lib.modulegraph
with modulegraph2
of course.)
If pushed a fix for this particular problem to the repo.
W.r.t. the update: A slightly clear message would be appreciated, what type hint that imported PyInstaller?
BTW. Note that modulegraph2 is a complete rewrite, you'll likely encounter more problems. The semantics are also slightly different from the old version as it uses the actual importlib machinery to load modules/extensions instead of reproducing it in the graph builder.
@ronaldoussoren thanks! I can't find this type hint now though for some reason (maybe I added it myself idk). If I come across it again I'll let you know.
@ronaldoussoren first of all, thanks for writing this library. Secondly, I'm a core developer of PyInstaller. I'm in the process of migrating modulegraph2 into PyInstaller to replace our heavily modded copy of the original modulegraph. However, in the process, I came across a rather major error which I'm honestly surprised has occured.
ModuleGraph.add_script
doesn't work - it errors out:I traced a bit more detail on this issue:
_process_namelist
is called when running the workstack, andimporting_module
is an instance ofScript
, in this case referring to thesetup.py
script I added to the graph.The exact folder structure I'm using can be found at https://github.com/Legorooj/pyinstaller/commit/d335bcebafcc. I'm not sure what else to add here, so please let me know if there's any info I can provide that I haven't already.
(I should note that this copy of the graph I'm running with this error has been modded slightly, though I can say for certain that the mod's I've made shouldn't affect
add_script
. None of the mods actually change how modulegraph works; they add features on top of it.)