Skip to content

Latest commit

 

History

History
61 lines (40 loc) · 1.84 KB

File metadata and controls

61 lines (40 loc) · 1.84 KB

Development instructions

The code for the plugin is in the src folder. Make sure you have required tools, such as Qt with Qt Editor and Qt Linquist installed by following this tutorial.

Setting up development environment

This project uses [uv] to manage python packages. Make sure to have it installed first.

  • Create a venv that is aware of system QGIS libraries: uv venv --system-site-packages
    • On Windows OSGeo4W v2 installs use <osgeo>/apps/PythonXX/python.exe with necessary patches
  • Activate the venv
  • Install the dependencies:
  • uv sync --all-packages --all-groups
  • Install pre-commit (prek implementation): prek install
  • Create a .env from .env.example, and configure at least the QGIS executable path
  • Launch development QGIS: uv run --directory components/plugin qpdt s
    • If you are in the components/plugin directory, you can also run uv run qpdt s or qpdt s

Requirements changes

To update requirements, do uv lock --upgrade-package <package>.

Commit message style

Commit messages should follow Conventional Commits notation.

Adding or editing source files

If you create or edit source files make sure that:

  • they contain absolute imports:

    from plugin.utils.exceptions import TestException # Good
    
    from ..utils.exceptions import TestException # Bad
    
  • you consider adding test files for the new functionality

Testing

Install python packages listed in requirements.txt to the virtual environment and run tests with:

pytest

uv OSGeo4W issue