Skip to content

Comments

Add support for dependency check while installing a plugin#38

Merged
m-kuhn merged 2 commits intoopengisch:mainfrom
gacarrillor:check_deps_on_plugin_install
Nov 10, 2025
Merged

Add support for dependency check while installing a plugin#38
m-kuhn merged 2 commits intoopengisch:mainfrom
gacarrillor:check_deps_on_plugin_install

Conversation

@gacarrillor
Copy link
Member

@gacarrillor gacarrillor commented Oct 10, 2025

In this way, QPIP will not only check deps when a plugin is activated/loaded, but also when it's installed (either via plugin repo or via ZIP).

This avoids getting Module Not Found errors when a plugin is installed and calling its classFactory() already imports other Python deps that are not present in the system.

Also, avoid waiting cursor set by QGIS for plugin installation when QPIP dialog is shown. We save the current cursor when entering the monkey patched loadPlugin, and restore it when leaving that method.

Rationale: Since the installer has already loaded the original qgis.utils.loadPlugin when QPIP gets loaded, monkey patching qgis.utils.loadPlugin is not enough. We need to monkey patch also installer.loadPlugin as well.
@gacarrillor gacarrillor force-pushed the check_deps_on_plugin_install branch from 7d59424 to 70f35a7 Compare October 10, 2025 16:56
…tore the active cursor when entering to the monkey patched loadPlugin, do the dependency check and enventual install, and finally restore the original active cursor when leaving.
@m-kuhn m-kuhn merged commit d7e49f5 into opengisch:main Nov 10, 2025
2 checks passed
@gacarrillor gacarrillor deleted the check_deps_on_plugin_install branch November 10, 2025 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants