Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: opengisch/qgis-plugin-ci
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.7.1
Choose a base ref
...
head repository: opengisch/qgis-plugin-ci
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
21 changes: 11 additions & 10 deletions .github/workflows/docs_builder.yml
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ on:
- 'docs/**/*'
- '.github/workflows/docs_builder.yml'
- 'qgispluginci/**/*.py'
- 'requirements/documentation.txt'
tags:
- "*"

@@ -25,7 +26,7 @@ permissions:

# Allow one concurrent deployment
concurrency:
group: "pages"
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
@@ -38,10 +39,10 @@ jobs:

steps:
- name: Get source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip"
@@ -69,25 +70,25 @@ jobs:
run: sphinx-build -b html -j auto -d docs/_build/cache -q docs docs/_build/html

- name: Save build doc as artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: documentation
path: docs/_build/html/*
if-no-files-found: error
retention-days: 30

- name: Setup Pages
uses: actions/configure-pages@v3
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: actions/configure-pages@v5
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'beta')

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: actions/upload-pages-artifact@v3
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'beta')
with:
# Upload entire repository
path: docs/_build/html/

- name: Deploy to GitHub Pages
id: deployment
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: actions/deploy-pages@v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'beta')
uses: actions/deploy-pages@v4
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run tests and release
name: 📦 Release

on:
push:
@@ -29,13 +29,13 @@ jobs:

steps:
- name: Retrieve artifact from Python build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python_wheel
path: dist/

- name: Create/update release on GitHub
uses: ncipollo/release-action@v1.12.0
uses: ncipollo/release-action@v1.14.0
with:
allowUpdates: true
artifacts: "builds**/*"
@@ -51,21 +51,21 @@ jobs:

steps:
- name: Retrieve artifact from Python build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python_wheel
path: dist/

# -- FROM HERE, A TAG IS REQUIRED ---
- name: Deploy to PyPI
uses: pypa/gh-action-pypi-publish@v1
uses: pypa/gh-action-pypi-publish@release/v1

with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Create/update release on GitHub
uses: ncipollo/release-action@v1.12.0
uses: ncipollo/release-action@v1.14.0
with:
allowUpdates: true
artifacts: "dist/*.tar.gz"
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test qgis-plugin-ci
name: 🧪 Run tests

concurrency: testing_environment

@@ -22,9 +22,9 @@ jobs:
# to avoid 'race conditions' against Transifex

- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
cache: "pip"
6 changes: 3 additions & 3 deletions .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
@@ -16,10 +16,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Get source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"
cache: "pip"
@@ -38,7 +38,7 @@ jobs:
run: >-
python -m build --sdist --wheel --outdir dist/ .
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: python_wheel
path: dist/*
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ exclude: ".venv|tests/dev/|tests/fixtures/"
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: check-added-large-files
args: ["--maxkb=500"]
@@ -19,18 +19,18 @@ repos:
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py38-plus]

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.8.0
hooks:
- id: black

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -53,10 +53,16 @@ commands:

## Requirements

- The code is under a **git** repository (`git archive` is used to bundle the plugin)
- There is no uncommitted changes when doing a package/release (there is an option to allow this)
- A configuration at the top directory either in `.qgis-plugin-ci` or in `setup.cfg` with a `[qgis-plugin-ci]` section.
- The source files of the plugin are within a sub-directory. The name of this directory will be used for the zip file.
- The code is under a **git** repository (`git archive` is used to bundle the plugin).
- There is no uncommitted changes when doing a package/release (althought there is an option to bypass this requirement).
- A configuration at the top directory either in `.qgis-plugin-ci` or in `setup.cfg` or `pyproject.toml` with a `[qgis-plugin-ci]` section (see `docs/configuration/options.md` for details).
- The source files of the plugin are within a sub-directory with a `metadata.txt` file with the following fields:
- description
- qgisMinimumVersion
- repository
- tracker

See `parameters.py` for more parameters and details. Notice that the name of this directory will be used for the zip file.

## QRC and UI files

@@ -75,7 +81,6 @@ Both can be achieved in the same process.
## Pre-release and experimental

In the case of a pre-release (either from the tag name according to [Semantic Versioning](https://semver.org/) or from the GitHub release), the plugin will be flagged as experimental.
If pushed to the QGIS plugin repository, the QGIS minimum version will be raised to QGIS 3.14 (only 3.14 and above support testing of experimental versions).

The tool will recognise any label use as a suffix to flag it as pre-release :

26 changes: 18 additions & 8 deletions docs/configuration/options.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# Settings
# Configuration

The plugin must have a configuration, located at the top directory:
## Settings

- either you use a `.qgis-plugin-ci` YAML file
- or you use a `[qgis-plugin-ci]` section in a `setup.cfg` file (which is used by many other tools).
The plugin must have a configuration, located at the top directory; it can be either:

In the configuration, you should at least provide the following configuration:
- a YAML file named `.qgis-plugin-ci`
- an INI file named `setup.cfg` with a `[qgis-plugin-ci]` section
- a TOML file (= your actual `pyproject.toml` file) with a `[tool.qgis-plugin-ci]` section.

- `plugin_path`, the folder where the source code is located
In the configuration, you should at least provide the following configuration:

Side note, the plugin path shouldn't have any dash character.
- `plugin_path`, the folder where the source code is located under the git repository. See

You can find a template `.qgis-plugin-ci` in this repository.
You can read the docstring of the [Parameters module](/_apidoc/qgispluginci.parameters) to know parameters which are available in the file.
You can read the docstring of the [Parameters module](/_apidoc/qgispluginci.parameters)
to know parameters which are available in the file.

## Conventions

@@ -47,3 +49,11 @@ plugin_path = QuickOSM
github_organization_slug = 3liz
project_slug = QuickOSM
```
### Using TOML file `pyproject.toml`

```toml
[tool.qgis-plugin-ci]
plugin_path = "qgis_plugin_ci_testing"
github_organization_slug = "opengisch"
project_slug = "qgis-plugin-ci"
```
11 changes: 11 additions & 0 deletions docs/configuration/plugin_path.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Plugin source path

The plugin path should be named in a distinctive form for the plugin
as it will be used in QGIS for the plugin folder name.
For instance, `my_super_transformer` for _My Super Transformer_ plugin.

Also, [`use_project_slug_as_plugin_directory`](/_apidoc/qgispluginci.parameters) can be used to alter this behavior.
If the source directory is not at the top level, the [`project_slug`](/_apidoc/qgispluginci.parameters)
will automatically be used in any case.

Side note, the plugin path shouldn't contain any dash character.
11 changes: 1 addition & 10 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ caption: Configuration
maxdepth: 1
---
configuration/options
configuration/plugin_path
configuration/exclude
configuration/submodules
configuration/translation
@@ -127,16 +128,6 @@ GeoMapFish Locator
VeriVD
^^^^^^

* translated on Transifex
* released on official repo
:::

:::{card}
:link: https://github.com/VeriVD/qgis_VeriVD/

VeriVD
^^^^^^

* released on custom repo as GitHub release
:::

3 changes: 2 additions & 1 deletion docs/usage/cli_package.md
Original file line number Diff line number Diff line change
@@ -26,7 +26,8 @@ optional arguments:
changes made by qgis-plugin-ci.
-d --disable-submodule-update
If omitted, a git submodule is updated. If specified, git submodules will not be updated/initialized before packaging.

-a ASSET_PATH, --asset-path ASSET_PATH
An additional asset path to add. Can be specified multiple times.
```

## Additional metadata
4 changes: 4 additions & 0 deletions docs/usage/cli_release.md
Original file line number Diff line number Diff line change
@@ -37,12 +37,16 @@ options:
--alternative-repo-url ALTERNATIVE_REPO_URL
The URL of the endpoint to publish the plugin (defaults to
plugins.qgis.org)
-a ASSET_PATH, --asset-path ASSET_PATH
An additional asset path to add. Can be specified multiple times.
--osgeo-username OSGEO_USERNAME
The Osgeo user name to publish the plugin.
--osgeo-password OSGEO_PASSWORD
The Osgeo password to publish the plugin.
```
If the exit code is `2`, it means the upload to the QGIS server has failed.
## Additional metadata
When packaging the plugin, some extra metadata information can be added if these keys are present in the `metadata.txt`:
2 changes: 1 addition & 1 deletion qgis_plugin_CI_testing/qgissettingmanager
Loading