Skip to content

Commit

Permalink
Fix path detection to check only external calls
Browse files Browse the repository at this point in the history
  • Loading branch information
LKajan committed Feb 1, 2024
1 parent eb8da6d commit e89a1c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

- Fix: Fix submodule usage detection when installed as an embedded dependency
- Fix: Consider only external calls when detecting plugin path

## [0.4.0] - 2024-1-24

Expand Down
6 changes: 3 additions & 3 deletions tools/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ def _is_module_qgis_plugin(module_name: str) -> IsPluginResult:
def _plugin_path_dependency() -> str:
"""Get the path to the plugin package folder.
Goes up the call stack and up the parent packages until package is
recognized as QGIS plugin.
Traverses packages of calling modules bottom up and checks if it is a qgis plugin.
"""

for frame_info in inspect.stack():
caller_module_name: Optional[str] = frame_info.frame.f_globals.get("__name__")
if caller_module_name is None:
if caller_module_name is None or "qgis_plugin_tools" in caller_module_name:
# We are interested only on calls from outside of qgis_plugin_tools
continue
for module_name in _iterate_modules(caller_module_name):
if is_plugin := _is_module_qgis_plugin(module_name):
Expand Down

0 comments on commit e89a1c7

Please sign in to comment.