From 258e94305620d22aec91ef99bde2ab996fa16006 Mon Sep 17 00:00:00 2001 From: Matej Matuska Date: Fri, 28 Jun 2024 16:11:35 +0200 Subject: [PATCH] snactor: Fix missing load_module --- leapp/snactor/__init__.py | 3 ++- res/container-tests/Containerfile.ubi10 | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/leapp/snactor/__init__.py b/leapp/snactor/__init__.py index 22ea99371..3264a26e2 100644 --- a/leapp/snactor/__init__.py +++ b/leapp/snactor/__init__.py @@ -2,6 +2,7 @@ import pkgutil import socket +from leapp.compat import load_module from leapp.utils.i18n import _ # noqa; pylint: disable=redefined-builtin from leapp.snactor import commands from leapp.snactor.commands import workflow @@ -30,7 +31,7 @@ def _load_commands_from(path): for importer, name, is_pkg in pkgutil.iter_modules([pkg_path]): if is_pkg: continue - mod = importer.find_module(name).load_module(name) + mod = load_module(importer, name) if hasattr(mod.cli, 'command'): if not mod.cli.command.parent: cli.command.add_sub(mod.cli.command) diff --git a/res/container-tests/Containerfile.ubi10 b/res/container-tests/Containerfile.ubi10 index 22d5a8f8d..6d6507cef 100644 --- a/res/container-tests/Containerfile.ubi10 +++ b/res/container-tests/Containerfile.ubi10 @@ -14,6 +14,9 @@ ENTRYPOINT virtualenv testenv -p "/usr/bin/$PYTHON_VENV" && \ pip install -U setuptools && \ pip install -U funcsigs && \ pip install -U -r requirements-tests.txt && \ + # NOTE(mmatuska): The pytest ver defined in requirements-tests is too old \ + # for Python 3.12 (missing imp module), there do an update here until we \ + # bump that. Similarly for six. \ pip install -U pytest && \ pip install -U six && \ pip install -U . && \