Skip to content

Config tweak#1369

Draft
Dreamsorcerer wants to merge 5 commits intodevfrom
config-tweak
Draft

Config tweak#1369
Dreamsorcerer wants to merge 5 commits intodevfrom
config-tweak

Conversation

@Dreamsorcerer
Copy link
Collaborator

@Dreamsorcerer Dreamsorcerer commented Feb 25, 2026

Problem

Working towards #1082, this helps standardise setting in modules which can then be expanded upon to enable further things such as CLI arguments to be injected.

Solution

Primary change to developers is that the __init__() method now uses a fixed signature and all configurable options appear in the config. That config is now a pydantic model, so it gets verified when the module is instantiated.

A lot of typing fixes were also made by changing incorrect references to Module to ModuleBase.

Breaking Changes

Subclasses of Module must now match the __init__() signature of the Module class.

@Dreamsorcerer Dreamsorcerer changed the base branch from main to dev February 25, 2026 17:14
setattr(cls, name, None)

def __init__(self, *args, **kwargs) -> None: # type: ignore[no-untyped-def]
def __init__(self, global_config: GlobalConfig = global_config, **kwargs: Any):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an alternative to asking subclasses (that need a custom __init__()) to include global_config here, I could move it into the ModuleConfig itself? Then subclasses will just pass kwargs alone.

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.

1 participant