From 606fefcaa26cc9748f2e7855f7de782e51aaa324 Mon Sep 17 00:00:00 2001 From: Jono Yang Date: Tue, 13 Aug 2024 15:23:45 -0700 Subject: [PATCH] Add code to collector init #512 #515 Signed-off-by: Jono Yang --- minecode/collectors/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/minecode/collectors/__init__.py b/minecode/collectors/__init__.py index e1521118..a916ea5b 100644 --- a/minecode/collectors/__init__.py +++ b/minecode/collectors/__init__.py @@ -6,3 +6,13 @@ # See https://github.com/aboutcode-org/purldb for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # + +import pkgutil + +""" +Minimal way to recursively import all submodules dynamically. If this module is +imported, all submodules will be imported: this triggers the actual registration +of miners. This should stay as the last import in this init module. +""" +for _, name, _ in pkgutil.walk_packages(__path__, prefix=__name__ + "."): + __import__(name)