GispoCoding / cookiecutter-qgis-plugin

A QGIS Plugin template to be set up with Cookiecutter
MIT License
22 stars 5 forks source link

Reference to qgis_plugin_tools is included in __init__.py even when submodule not included #44

Closed JuhoErvasti closed 7 months ago

JuhoErvasti commented 7 months ago

Describe the bug A reference to qgis_plugin_tools persists even when the use_qgis_plugin_tools option is specified as 'n'. This causes a ClassFactory error in QGIS.

To Reproduce Steps to reproduce the behavior:

Build with the template, in the last option choose 'n'. Load plugin to QGIS and notice the error

Expected behavior

These lines should be excluded.

from {{cookiecutter.plugin_package}}.qgis_plugin_tools.infrastructure.debugging import setup_debugpy  # noqa F401
from {{cookiecutter.plugin_package}}.qgis_plugin_tools.infrastructure.debugging import setup_ptvsd  # noqa F401
from {{cookiecutter.plugin_package}}.qgis_plugin_tools.infrastructure.debugging import setup_pydevd  # noqa F401

debugger = os.environ.get("QGIS_PLUGIN_USE_DEBUGGER", "").lower()
if debugger in {"debugpy", "ptvsd", "pydevd"}:
    locals()["setup_" + debugger]()

Environment (please complete the following information):