Skip to content

Commit 8ae17a5

Browse files
committed
Refactor test workflow
1 parent 8562f4d commit 8ae17a5

23 files changed

Lines changed: 761 additions & 489 deletions

.docker/docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
services:
2+
qgis:
3+
user: ${UID}:${GID}
4+
image: ${QGIS_IMAGE_TAG}
5+
network_mode: host
6+
container_name: DataPlotly-tests
7+
environment:
8+
QGIS_VERSION: ${QGIS_VERSION}
9+
volumes:
10+
- ..:/src
11+
command: bash /src/.docker/run-tests.sh

.docker/run-tests.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ VENV=/src/.docker-venv-$QGIS_VERSION
1212
python3 -m venv $VENV --system-site-package
1313

1414
echo "Installing requirements..."
15-
$VENV/bin/pip install -q --no-cache -r REQUIREMENTS_TESTING.txt
15+
$VENV/bin/pip install -q --no-cache -r requirements/tests.txt
1616

1717
cd tests && $VENV/bin/python -m pytest -v
18-
19-

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Test plugin
1+
name: Tests
22

33
on:
44
push:
5-
tags:
5+
branches:
66
- "*"
77
pull_request:
88
branches:
9-
- main
9+
- master
1010

1111
jobs:
1212
tests:

.github/workflows/transifex.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Transifex 🗺
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- '**.py'
9+
- '**.ui'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
if: github.repository_owner == 'ghtmtt'
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Set up Python 3.10
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: "3.10"
22+
23+
- name: Install Python requirements
24+
run: pip install qgis-plugin-ci
25+
26+
- name: Push to Transifex
27+
run: qgis-plugin-ci push-translation ${{ secrets.TRANSIFEX_TOKEN }}

Makefile

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ REQUIREMENTS_GROUPS= \
1515

1616
REQUIREMENTS=$(patsubst %, requirements/%.txt, $(REQUIREMENTS_GROUPS))
1717

18-
update-requirements: $(REQUIREMENS)
18+
update-requirements: $(REQUIREMENTS)
1919

2020
requirements/%.txt: uv.lock
2121
@echo "Updating requirements for '$*'"; \
@@ -33,18 +33,18 @@ requirements/%.txt: uv.lock
3333
LINT_TARGETS=$(PYTHON_MODULE) tests $(EXTRA_LINT_TARGETS)
3434

3535
lint::
36-
@ $(UV_RUN) ruff check --preview --output-format=concise $(LINT_TARGETS)
36+
@ruff check --preview --output-format=concise $(LINT_TARGETS)
3737

3838
lint:: typecheck
3939

4040
lint-fix:
41-
@ $(UV_RUN) ruff check --preview --fix $(LINT_TARGETS)
41+
@ruff check --preview --fix $(LINT_TARGETS)
4242

4343
format:
44-
@ $(UV_RUN) ruff format $(LINT_TARGETS)
44+
@ruff format $(LINT_TARGETS)
4545

4646
typecheck:
47-
@ $(UV_RUN) mypy $(LINT_TARGETS)
47+
@mypy $(LINT_TARGETS)
4848

4949
#
5050
# Tests
@@ -67,4 +67,19 @@ coverage: covtest
6767
@echo "Building coverage report"
6868
@ $(UV_RUN) coverage html
6969

70-
70+
#
71+
# Tests using docker image
72+
#
73+
QGIS_IMAGE_REPOSITORY ?=qgis/qgis
74+
QGIS_IMAGE_TAG ?= $(QGIS_IMAGE_REPOSITORY):$(QGIS_VERSION)
75+
76+
export QGIS_VERSION
77+
export QGIS_IMAGE_TAG
78+
export UID=$(shell id -u)
79+
export GID=$(shell id -g)
80+
docker-test:
81+
cd .docker && docker compose up \
82+
--quiet-pull \
83+
--abort-on-container-exit \
84+
--exit-code-from qgis
85+
cd .docker && docker compose down -v

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# DataPlotly
22

33
[![QGIS.org](https://img.shields.io/badge/QGIS.org-published-green)](https://plugins.qgis.org/plugins/DataPlotly/)
4-
[![Test plugin](https://github.com/ghtmtt/DataPlotly/actions/workflows/test_plugin.yaml/badge.svg)](https://github.com/ghtmtt/DataPlotly/actions/workflows/test_plugin.yaml)
4+
[![Test plugin](https://github.com/ghtmtt/DataPlotly/actions/workflows/tests.yaml/badge.svg)](https://github.com/ghtmtt/DataPlotly/actions/workflows/test_plugin.yaml)
55
[![Transifex 🗺](https://github.com/ghtmtt/DataPlotly/actions/workflows/transifex.yml/badge.svg)](https://github.com/ghtmtt/DataPlotly/actions/workflows/transifex.yml)
66

77
**Documentation: https://dataplotly-docs.readthedocs.io/en/latest/intro.html**

pyproject.toml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ keywords = [
99
"QGIS", "plugin", "plots", "vector", "graphs",
1010
"datavis", "dataviz", "dataplotly",
1111
]
12-
license = {file = "LICENSE"}
12+
license-files = ["LICENSE"]
1313
classifiers = [
1414
"Programming Language :: Python :: 3",
1515
"Programming Language :: Python :: 3.9",
@@ -20,7 +20,9 @@ classifiers = [
2020
"Programming Language :: Python :: 3.14",
2121
"Topic :: Scientific/Engineering :: GIS",
2222
]
23-
version = "5.0.0"
23+
# Dummy version number required
24+
# not used for release
25+
version = "0.dev"
2426

2527
[project.urls]
2628
homepage= "https://dataplotly-docs.readthedocs.io"
@@ -46,30 +48,13 @@ lint = [
4648
"mypy",
4749
]
4850
packaging = [
49-
"qgis-plugin-package-ci; python_full_version >= '3.12'",
50-
"qgis-plugin-transifex-ci; python_full_version >= '3.12'",
51+
"qgis-plugin-ci"
5152
]
5253

5354

5455
[tool.uv.sources]
55-
qgis-plugin-package-ci = { git = "https://github.com/3liz/qgis-plugin-package-ci.git" }
56-
qgis-plugin-transifex-ci = { git = "https://github.com/3liz/qgis-plugin-transifex-ci.git" }
5756
pytest-qgis = { git = "https://github.com/3liz/pytest-qgis.git" }
5857

59-
#
60-
# Package ci
61-
#
62-
63-
[tool.package-ci]
64-
plugin_source = "DataPlotly"
65-
github_organization_slug = "ghtmtt"
66-
project_slug = "DataPlotly"
67-
68-
[tool.qgis-transifex-ci]
69-
plugin_source = "DataPlotly"
70-
organization = "dataplotly"
71-
project = "dataplotly-ui"
72-
resource = "application"
7358

7459
#
7560
# Ruff

requirements/dev.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This file was autogenerated by uv via the following command:
2+
# uv export --format requirements.txt --no-annotate --no-editable --no-hashes --only-group dev -o requirements/dev.txt
3+
colorama==0.4.6 ; sys_platform == 'win32'
4+
coverage==7.13.1
5+
deepdiff==8.6.1
6+
exceptiongroup==1.3.1 ; python_full_version < '3.11'
7+
iniconfig==2.3.0
8+
librt==0.7.7 ; platform_python_implementation != 'PyPy'
9+
mock==5.2.0
10+
mypy==1.19.1
11+
mypy-extensions==1.1.0
12+
narwhals==2.15.0
13+
orderly-set==5.5.0
14+
packaging==25.0
15+
pathspec==1.0.1
16+
plotly==6.5.0
17+
pluggy==1.6.0
18+
pygments==2.19.2
19+
pytest==9.0.2
20+
pytest-qgis @ git+https://github.com/3liz/pytest-qgis.git@555b184158a58f6922e0dfb6df25ad90b2cc8c24
21+
ruff==0.14.10
22+
semver==3.0.4
23+
tomli==2.3.0 ; python_full_version <= '3.11'
24+
typing-extensions==4.15.0

requirements/lint.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This file was autogenerated by uv via the following command:
2+
# uv export --format requirements.txt --no-annotate --no-editable --no-hashes --only-group lint -o requirements/lint.txt
3+
librt==0.7.7 ; platform_python_implementation != 'PyPy'
4+
mypy==1.19.1
5+
mypy-extensions==1.1.0
6+
pathspec==1.0.1
7+
ruff==0.14.10
8+
tomli==2.3.0 ; python_full_version < '3.11'
9+
typing-extensions==4.15.0

requirements/packaging.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This file was autogenerated by uv via the following command:
2+
# uv export --format requirements.txt --no-annotate --no-editable --no-hashes --only-group packaging -o requirements/packaging.txt
3+
asttokens==3.0.1
4+
certifi==2026.1.4
5+
cffi==2.0.0 ; platform_python_implementation != 'PyPy'
6+
charset-normalizer==3.4.4
7+
click==8.3.1
8+
colorama==0.4.6 ; sys_platform == 'win32'
9+
cryptography==46.0.3
10+
deprecated==1.3.1
11+
future==1.0.0
12+
gitdb==4.0.12
13+
gitpython==3.1.46
14+
idna==3.11
15+
parsimonious==0.11.0
16+
pycparser==2.23 ; implementation_name != 'PyPy' and platform_python_implementation != 'PyPy'
17+
pygithub==2.5.0
18+
pyjwt==2.10.1
19+
pynacl==1.6.2
20+
pyqt5==5.15.11
21+
pyqt5-qt5==5.15.18
22+
pyqt5-sip==12.17.2
23+
pyqt5ac==1.2.1
24+
pyseeyou==1.0.2
25+
python-slugify==8.0.4
26+
pyyaml==6.0.3
27+
qgis-plugin-ci==2.8.10
28+
regex==2025.11.3
29+
requests==2.32.5
30+
six==1.17.0
31+
smmap==5.0.2
32+
text-unidecode==1.3
33+
toml==0.10.2
34+
toolz==1.1.0
35+
transifex-python==3.7.0
36+
typing-extensions==4.15.0
37+
urllib3==2.6.2
38+
wrapt==2.0.1

0 commit comments

Comments
 (0)