From 1c5119109c1999e88403c60d972d850ac19ab373 Mon Sep 17 00:00:00 2001 From: Mark Final Date: Sat, 13 Dec 2025 18:50:10 +0000 Subject: [PATCH 1/2] Refactor: Moved commands/conanconf to cruizlib --- src/cruiz/commands/context.py | 2 +- src/cruiz/manage_local_cache/managelocalcachesdialog.py | 2 +- src/cruiz/remote_browser/pages/packagereferencepage.py | 2 +- src/{cruiz => cruizlib}/commands/conanconf.py | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename src/{cruiz => cruizlib}/commands/conanconf.py (100%) diff --git a/src/cruiz/commands/context.py b/src/cruiz/commands/context.py index 51047f80..da86b0f7 100755 --- a/src/cruiz/commands/context.py +++ b/src/cruiz/commands/context.py @@ -27,6 +27,7 @@ from .conaninvocation import ConanInvocation if typing.TYPE_CHECKING: + from cruizlib.commands.conanconf import ConanConfigBoolean from cruizlib.interop.packagebinaryparameters import PackageBinaryParameters from cruizlib.interop.packageidparameters import PackageIdParameters from cruizlib.interop.packagenode import PackageNode @@ -35,7 +36,6 @@ from cruizlib.interop.reciperevisionsparameters import RecipeRevisionsParameters from cruizlib.interop.searchrecipesparameters import SearchRecipesParameters - from .conanconf import ConanConfigBoolean from .logdetails import LogDetails logger = logging.getLogger(__name__) diff --git a/src/cruiz/manage_local_cache/managelocalcachesdialog.py b/src/cruiz/manage_local_cache/managelocalcachesdialog.py index 48c0779e..0fc1d76d 100755 --- a/src/cruiz/manage_local_cache/managelocalcachesdialog.py +++ b/src/cruiz/manage_local_cache/managelocalcachesdialog.py @@ -13,7 +13,6 @@ from PySide6 import QtCore, QtGui, QtWidgets -from cruiz.commands.conanconf import ConanConfigBoolean from cruiz.commands.context import ConanContext from cruiz.commands.logdetails import LogDetails from cruiz.pyside6.local_cache_manage import Ui_ManageLocalCaches @@ -33,6 +32,7 @@ from cruiz.widgets.util import BlockSignals import cruizlib.globals +from cruizlib.commands.conanconf import ConanConfigBoolean from cruizlib.constants import DEFAULT_CACHE_NAME from cruizlib.interop.pod import ConanHook diff --git a/src/cruiz/remote_browser/pages/packagereferencepage.py b/src/cruiz/remote_browser/pages/packagereferencepage.py index 6a3d87f7..92493686 100644 --- a/src/cruiz/remote_browser/pages/packagereferencepage.py +++ b/src/cruiz/remote_browser/pages/packagereferencepage.py @@ -8,11 +8,11 @@ from PySide6 import QtCore, QtGui, QtWidgets -from cruiz.commands.conanconf import ConanConfigBoolean from cruiz.settings.managers.namedlocalcache import AllNamedLocalCacheSettingsReader from cruiz.widgets.util import BlockSignals import cruizlib.globals +from cruizlib.commands.conanconf import ConanConfigBoolean from cruizlib.interop.searchrecipesparameters import SearchRecipesParameters from .page import Page diff --git a/src/cruiz/commands/conanconf.py b/src/cruizlib/commands/conanconf.py similarity index 100% rename from src/cruiz/commands/conanconf.py rename to src/cruizlib/commands/conanconf.py From f788f6e2c077aa143b31da8e2ff566529169db40 Mon Sep 17 00:00:00 2001 From: Mark Final Date: Sat, 13 Dec 2025 18:58:16 +0000 Subject: [PATCH 2/2] Refactor: Moved MetaRequestConanInvocation and MessageReplyProcessor to cruizlib/commands, so it's consistent with it's original location in cruiz --- src/cruiz/commands/conaninvocation.py | 2 +- src/cruiz/commands/context.py | 2 +- src/cruizlib/{ => commands}/messagereplyprocessor.py | 8 +++++--- .../{workers => commands}/metarequestconaninvocation.py | 0 tests/ttypes.py | 2 +- tests/workers/conftest.py | 4 ++-- tests/workers/test_meta_cruiz.py | 2 +- 7 files changed, 11 insertions(+), 9 deletions(-) rename src/cruizlib/{ => commands}/messagereplyprocessor.py (97%) rename src/cruizlib/{workers => commands}/metarequestconaninvocation.py (100%) diff --git a/src/cruiz/commands/conaninvocation.py b/src/cruiz/commands/conaninvocation.py index 581fd223..03595d89 100755 --- a/src/cruiz/commands/conaninvocation.py +++ b/src/cruiz/commands/conaninvocation.py @@ -21,7 +21,7 @@ from cruiz.settings.managers.generalpreferences import GeneralSettingsReader -from cruizlib.messagereplyprocessor import MessageReplyProcessor +from cruizlib.commands.messagereplyprocessor import MessageReplyProcessor import psutil diff --git a/src/cruiz/commands/context.py b/src/cruiz/commands/context.py index da86b0f7..ece53c29 100755 --- a/src/cruiz/commands/context.py +++ b/src/cruiz/commands/context.py @@ -17,10 +17,10 @@ from cruiz.settings.managers.namedlocalcache import NamedLocalCacheSettingsReader import cruizlib.workers.api as workers_api +from cruizlib.commands.metarequestconaninvocation import MetaRequestConanInvocation from cruizlib.constants import DEFAULT_CACHE_NAME from cruizlib.exceptions import RecipeInspectionError from cruizlib.interop.commandparameters import CommandParameters -from cruizlib.workers.metarequestconaninvocation import MetaRequestConanInvocation from cruizlib.workers.utils.text2html import text_to_html from .conanenv import get_conan_env diff --git a/src/cruizlib/messagereplyprocessor.py b/src/cruizlib/commands/messagereplyprocessor.py similarity index 97% rename from src/cruizlib/messagereplyprocessor.py rename to src/cruizlib/commands/messagereplyprocessor.py index 3b07755c..63bce121 100755 --- a/src/cruizlib/messagereplyprocessor.py +++ b/src/cruizlib/commands/messagereplyprocessor.py @@ -35,10 +35,12 @@ logger = logging.getLogger(__name__) -# needed for coverage to record from a QThread -# see https://github.com/coveragepy/coveragepy/issues/686 def coverage_resolve_trace(fn: typing.Any) -> typing.Any: - """.""" + """ + Allow measuring coverage of a QThread function. + + See https://github.com/coveragepy/coveragepy/issues/686 + """ @functools.wraps(fn) def _wrapped( # pragma: no cover diff --git a/src/cruizlib/workers/metarequestconaninvocation.py b/src/cruizlib/commands/metarequestconaninvocation.py similarity index 100% rename from src/cruizlib/workers/metarequestconaninvocation.py rename to src/cruizlib/commands/metarequestconaninvocation.py diff --git a/tests/ttypes.py b/tests/ttypes.py index dfa20364..84152555 100644 --- a/tests/ttypes.py +++ b/tests/ttypes.py @@ -6,6 +6,7 @@ from PySide6 import QtCore +from cruizlib.commands.messagereplyprocessor import MessageReplyProcessor from cruizlib.interop.commandparameters import CommandParameters from cruizlib.interop.message import Message from cruizlib.interop.packagebinaryparameters import PackageBinaryParameters @@ -13,7 +14,6 @@ from cruizlib.interop.packagerevisionsparameters import PackageRevisionsParameters from cruizlib.interop.reciperevisionsparameters import RecipeRevisionsParameters from cruizlib.interop.searchrecipesparameters import SearchRecipesParameters -from cruizlib.messagereplyprocessor import MessageReplyProcessor from cruizlib.multiprocessingmessagequeuetype import ( MultiProcessingMessageQueueType, MultiProcessingStringJoinableQueueType, diff --git a/tests/workers/conftest.py b/tests/workers/conftest.py index ec547e7b..456a3e7c 100644 --- a/tests/workers/conftest.py +++ b/tests/workers/conftest.py @@ -17,6 +17,8 @@ from PySide6 import QtCore import cruizlib.workers.api as workers_api +from cruizlib.commands.messagereplyprocessor import MessageReplyProcessor +from cruizlib.commands.metarequestconaninvocation import MetaRequestConanInvocation from cruizlib.globals import CONAN_MAJOR_VERSION, CONAN_VERSION_COMPONENTS from cruizlib.interop.commandparameters import CommandParameters from cruizlib.interop.message import ( @@ -28,8 +30,6 @@ Stdout, Success, ) -from cruizlib.messagereplyprocessor import MessageReplyProcessor -from cruizlib.workers.metarequestconaninvocation import MetaRequestConanInvocation # pylint: disable=wrong-import-order import pytest diff --git a/tests/workers/test_meta_cruiz.py b/tests/workers/test_meta_cruiz.py index 13b3d4b8..0025a59d 100644 --- a/tests/workers/test_meta_cruiz.py +++ b/tests/workers/test_meta_cruiz.py @@ -10,7 +10,7 @@ if typing.TYPE_CHECKING: from unittest.mock import MagicMock - from cruizlib.workers.metarequestconaninvocation import MetaRequestConanInvocation + from cruizlib.commands.metarequestconaninvocation import MetaRequestConanInvocation def test_meta_get_version(