-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reorganize Hy internal imports #2132
Comments
orrrrrrr my sleep-addled brain forgot to remove the early call to That being said, (at least as it currently stands) anything that calls |
Hyrule will eliminate the need to auto-import functions, and but not to auto-require core macros. I'm not sure how much that will help, ultimately. |
Hy still desperately needs a reorganization pass to eliminate the complex dependency chains that scauligi mentioned. the whole code base is quite fragile to change as it stands. |
this graph is giving me anxiety |
As noted in #2131, Hy ends up loading most of its internal modules just from the initial import of the top-level module.
Turns out it's not entirely trivial to fix this, since we have complicated dependency chains such as
hy.importer._inject_builtins()
needinghy.macros.load_macros()
, buthy.macros
importshy.compiler
(which itself importsmacroexpand
back fromhy.macros
...)The whole thing is fragile enough that (naive) initial attempts just result in a bunch of
ImportError: cannot import name '...' from partially initialized module '...' (most likely due to a circular import)
.I think the proper solution for this is going to be a (potentially invasive?) reorganization so that dependencies are much clearer/saner and so that we actually get the benefit of just-in-time submodule loading.
The text was updated successfully, but these errors were encountered: