diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 02032d5b..4cb38130 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,7 @@ jobs: - name: test run: | + docker compose run -e QT_QPA_PLATFORM=offscreen qgis-desktop make check docker compose run -e QT_QPA_PLATFORM=offscreen qgis-desktop make test docker compose run -e QT_QPA_PLATFORM=offscreen qgis-desktop make flake8 docker compose run qgis-desktop make docstrings diff --git a/.gitignore b/.gitignore index 9dc00eac..c82f40c2 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ tests/data/small_2019_01_2entries_4tiff.sqlite .pytest_cache/v/cache/nodeids .h5py_marker constraints.txt +requirements.in diff --git a/Makefile b/Makefile index 5adc9943..1a19f2a1 100755 --- a/Makefile +++ b/Makefile @@ -84,6 +84,12 @@ zip: compile find /tmp/$(PLUGINNAME) -iname "*.pyc" -delete cd /tmp; zip -9r $(CURDIR)/$(PLUGINNAME).zip $(PLUGINNAME) +check: constraints.txt + # Use pip-compile to check whether all dependencies version constraints are met. + cp constraints.txt requirements.in + pip-compile --dry-run + rm requirements.in + package: compile # Create a zip package of the plugin named $(PLUGINNAME).zip. # This requires use of git (your plugin development directory must be a diff --git a/dependencies.py b/dependencies.py index 0e380509..1968f6b6 100644 --- a/dependencies.py +++ b/dependencies.py @@ -29,17 +29,18 @@ from PyQt5.QtWidgets import QProgressDialog from qgis.core import Qgis -import setuptools # noqa: https://github.com/pypa/setuptools/issues/2993 import importlib import logging import os import pkg_resources import platform +import setuptools # noqa: https://github.com/pypa/setuptools/issues/2993 import shutil import subprocess import sys import tarfile + # in case the dependency is a tar, the constraint should be the # explicit version (e.g. "==3.8.0") Dependency = namedtuple("Dependency", ["name", "package", "constraint", "tar"]) diff --git a/requirements-dev.txt b/requirements-dev.txt index cfe41755..d3cedc0e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -10,6 +10,7 @@ docstr-coverage >= 1.0.4 flake8 isort mock +pip-tools pytest < 8.0 pytest-cov pytest-flake8