Skip to content

Refactor the new module loading system to using pkgutil.iter_modules#786

Merged
rogerlz merged 1 commit intomainfrom
module_loading
Jan 2, 2026
Merged

Refactor the new module loading system to using pkgutil.iter_modules#786
rogerlz merged 1 commit intomainfrom
module_loading

Conversation

@kageurufu
Copy link
Copy Markdown
Member

@kageurufu kageurufu commented Dec 18, 2025

This subtly changes loading behavior. Previously, only name.py or name/init.py would be loaded. By iterating modules, this will also find compiled .so modules as as well as pre-compiled .pyc. It also raises errors on plugin overrides early, instead of when the module is loaded.

This simplifies the code a fair bit, and makes plugins and overrides a bit more explicit

#705 has been rebased over this, and now works with the new system

Checklist

  • pr title makes sense
  • added a test case if possible
  • if new feature, added to the readme
  • ci is happy and green

This subtly changes loading behavior. Previously, only name.py or name/__init__.py
would be loaded. By iterating modules, this will also find compiled .so modules as
as well as pre-compiled .pyc.
@rogerlz rogerlz merged commit 2c9b0b4 into main Jan 2, 2026
2 checks passed
@rogerlz rogerlz deleted the module_loading branch January 2, 2026 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants