Thank you for your interest in contributing to QGIS DevTools! This guide will help you get started with development and explain how to contribute effectively to the project.
- About the Project
- Development Environment Setup
- Building and Testing
- Code Style and Standards
- Making Contributions
- Issue Reporting
- Pull Request Process
- Community and Support
QGIS DevTools is a toolkit for QGIS plugin developers that provides advanced debugging capabilities, including remote debugging support via debugpy. The plugin allows developers to connect VS Code debugger directly to QGIS processes.
- License: GNU GPL v.2 or later
- Language: Python 3.7+
- Target Platform: QGIS 3.22+
- Maintained by: NextGIS
- Python 3.7 or later
- QGIS 3.22 or later
- Git
- A text editor or IDE (VS Code recommended)
- Qt Linguist tools (optional, for translation compilation)
- On Ubuntu/Debian:
sudo apt install qttools5-dev-tools - On macOS:
brew install qt5 - On Windows: Install Qt Creator or Qt tools
- On Ubuntu/Debian:
-
Clone the repository:
git clone https://github.com/nextgis/qgis_devtools.git cd qgis_devtools -
Install development dependencies:
pip install -e ".[dev]" -
Set up pre-commit hooks (recommended):
pre-commit install
-
Configure the development environment:
python setup.py config vscode
-
Bootstrap the plugin (compile UI files, resources, and translations):
python setup.py bootstrap
Note: If you don't have Qt Linguist tools installed, you can skip translation compilation:
python setup.py bootstrap --ui --qrc
-
Build the plugin package:
python setup.py build
This creates a distributable ZIP file in the
build/directory.
Install in development mode (creates symlinks, changes reflect immediately):
python setup.py install --editableInstall normally:
python setup.py installForce reinstall:
python setup.py install --force- Start QGIS with your development profile
- Enable the DevTools plugin in the Plugin Manager
- Test the debugging functionality by:
- Opening the DevTools menu
- Starting a debugpy server
- Connecting from VS Code
python setup.py uninstallbootstrap- Compile UI files, resources, and translations--ui- Compile only forms--qrc- Compile only resources--ts- Compile only translations
build- Create distributable plugin packageinstall- Install plugin to QGISuninstall- Remove plugin from QGISclean- Remove compiled filesupdate_ts- Update translation filesconfig- Configure development environment
This project uses Ruff for linting and formatting:
# Run linter
ruff check .
# Run formatter
ruff format .
# Fix auto-fixable issues
ruff check --fix .The project uses pre-commit hooks that automatically:
- Run Ruff linting and formatting
- Add license headers to Python files
- Validate TOML files
Install and run pre-commit:
pre-commit install
pre-commit run --all-files- Python Version: Support Python 3.7+
- Line Length: 79 characters maximum
- Code Style: Follow PEP8 conventions. When overriding Qt base class methods that use camelCase, suppress linting with
# noqa: N802 - Docstrings: Follow PEP 257 conventions
- Type Hints: Use type annotations where appropriate
- License Headers: All Python files must include the GPL license header
- Import Organization: Use isort-compatible import ordering
- PyQt Imports: Import PyQt classes from the qgis module for better compatibility (e.g.,
from qgis.PyQt.QtCore import QTimer)
The main source code is organized as follows:
src/devtools/- Main plugin source codesrc/devtools/core/- Common code (utilities, settings, constants, compatibility)src/devtools/shared/- Base classes and shared componentssrc/devtools/debug/- Feature directory for debug-related classes and interfacesrc/devtools/ui/- Common widgets and helper functionssrc/devtools/i18n/- Translation filessrc/devtools/resources/- Icons and other resourcestests/- Test files (if any)
We welcome various types of contributions:
- Bug fixes - Fix issues in existing functionality
- Feature enhancements - Improve existing features
- New features - Add new debugging tools or capabilities
- Documentation - Improve docs, comments, or examples
- For user documentation updates and corrections, use: https://github.com/nextgis/docs_ngqgis/edit/en/source/devtools.rst
- Translations - Add or update language translations
- Testing - Add tests or improve test coverage
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following the code standards
-
Test your changes:
- Build and install the plugin
- Test in QGIS manually
- Run linting checks
-
Commit your changes:
git add . git commit -m "Descriptive commit message"
-
Push and create a pull request
To update translations:
-
Update translation files:
python setup.py update_ts
-
Edit translation files in
src/devtools/i18n/ -
Test the translations by building and installing the plugin
- Check existing issues to avoid duplicates
- Ensure you're using the latest plugin version
- Gather relevant information (QGIS version, OS, plugin version, logs)
Include:
- Clear description of the issue
- Steps to reproduce
- Expected vs actual behavior
- QGIS version information (Help → About → copy table)
- Relevant log messages from QGIS Log Messages panel
- Screenshots or recordings if applicable
Include:
- Clear description of the proposed feature
- Use case and motivation
- Possible implementation approach
- Any relevant examples or mockups
-
Ensure your changes work:
- Build and test the plugin thoroughly
- Check that existing functionality isn't broken
- Verify code follows style guidelines
-
Update documentation if needed:
- Update docstrings for new/changed functions
- Update README.md if adding major features
- Add or update comments for complex code
-
Check dependencies:
- Avoid adding new dependencies unless absolutely necessary
- Ensure compatibility with QGIS 3.22+
- Provide clear description of changes and motivation
- Include verification steps for reviewers
- Keep changes focused - one feature/fix per PR
- When the original repository changes, perform a rebase to keep your branch up to date
- Maintainers will review your PR and may request changes
- Address feedback by pushing new commits to your branch
- Once approved, maintainers will merge your PR
- Consider your PR a learning opportunity - feedback helps improve code quality
- Documentation: User Guide
- Issues: GitHub Issues
- Discord: NextGIS Discord
- Forum: NextGIS Community
- Telegram: NextGIS Talks
- Commercial Support: Contact NextGIS
- Be respectful and inclusive
- Focus on constructive feedback
- Help others learn and grow
- Follow GitHub's community guidelines
Contributors are recognized in:
- Git commit history
- Plugin credits (for significant contributions)
- Community acknowledgments
Translation compilation errors (lrelease not found):
- Install Qt Linguist tools (see Prerequisites section)
- Or skip translation compilation:
python setup.py bootstrap --ui --qrc - For distribution builds, translations should be compiled
-
Enable plugin debug messages:
- Settings → Options → QGIS DevTools → Enable plugin debug messages
-
Remote Debugging:
- Use the plugin's own debugging capabilities
- Set up VS Code with Python debugger
- Connect to the debugpy server started by the plugin
- Refer to QGIS API Documentation
- QGIS Developer Guide
- PyQGIS Developer Cookbook
- Use QGIS Python Console for API exploration
- Follow QGIS plugin development best practices
- Test with different QGIS versions (3.22+)
- Test on different operating systems if possible
- Test with different plugin combinations
Thank you for contributing to QGIS DevTools! Your contributions help make QGIS plugin development easier for everyone.