Skip to content

Commit

Permalink
fix pythonizations trying to import local modules as pythonization.su…
Browse files Browse the repository at this point in the history
…bmodule (#667)
  • Loading branch information
m-fila authored Sep 9, 2024
1 parent 5618179 commit df5430c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/podio/pythonizations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
"""cppyy pythonizations for podio"""

from importlib import import_module
from pkgutil import walk_packages
from pkgutil import iter_modules
from os import path
from .utils.pythonizer import Pythonizer


def load_pythonizations(namespace):
"""Register all available pythonizations for a given namespace"""
module_names = [name for _, name, _ in walk_packages(__path__) if not name.startswith("test_")]
pythonizations_dir = path.dirname(__file__)
# find only direct submodules of the current module
module_names = [name for _, name, _ in iter_modules([pythonizations_dir])]
for module_name in module_names:
import_module(__name__ + "." + module_name)
pythonizers = sorted(Pythonizer.__subclasses__(), key=lambda x: x.priority())
Expand Down

0 comments on commit df5430c

Please sign in to comment.