lib.init.detect_modules(): Renovate signature

- Remove package_name and package_path from the prototype of detect_modules(). They can and should be deduced from namespace['__name__'] and namespace['__path__'], respectively.
- Make prefix default to None, which signifies "Don't filter by prefix".
- Add an optional extend_namespace parameter, which will make the function append the module's __name__ to its __path__. This defaults to True, thereby adding a side effect to the function. Which is always wanted in the case for all callers of this function.
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-06-05 07:22:54 +02:00 committed by janware DevOps
commit 3dc452d9b4
Signed by: DevOps
SSH key fingerprint: SHA256:cZiw7ExG5q3KAVm7Jse3rGITowu0VjgUgNMPbifmY8g
6 changed files with 20 additions and 18 deletions

View file

@ -1,8 +1,6 @@
from ..lib.init import detect_modules
__all__ = detect_modules(
package_name = __name__,
package_path = __path__,
namespace = globals(),
prefix = 'Cmd',
skip = {'Cmd'},

View file

@ -1,8 +1,6 @@
from ...lib.init import detect_modules
__all__ = detect_modules(
package_name = __name__,
package_path = __path__,
namespace = globals(),
prefix = 'Cmd',
skip = {'Cmd'},

View file

@ -1,8 +1,6 @@
from ...lib.init import detect_modules
__all__ = detect_modules(
package_name = __name__,
package_path = __path__,
namespace = globals(),
prefix = 'Cmd',
skip = {'Cmd'},

View file

@ -1,8 +1,6 @@
from ...lib.init import detect_modules
__all__ = detect_modules(
package_name = __name__,
package_path = __path__,
namespace = globals(),
prefix = 'Cmd',
skip = {'Cmd'},

View file

@ -1,8 +1,6 @@
from ....lib.init import detect_modules
__all__ = detect_modules(
package_name = __name__,
package_path = __path__,
namespace = globals(),
prefix = 'Cmd',
skip = {'Cmd'},