Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Project created with the Cookiecutter QGIS Plugin Template.
  • Loading branch information
nmaarnio committed Sep 11, 2024
0 parents commit ccb7179
Show file tree
Hide file tree
Showing 38 changed files with 2,408 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.py]
indent_style = space
indent_size = 4

[*.ui]
indent_style = space
indent_size = 2
max_line_length = 100000

[*.md]
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
# Flake8 is used only for QGIS rules. Ruff is used for all other rules.
select = QGS
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- Plugin: [e.g. 1.0]
- QGIS [e.g. 3.14]
- Python: [e.g. 3.8]
- OS: [e.g. Windows 10, Fedora 32]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Expected behaviour**
A clear and concise description of what you'd like to happen if you do x.

**Current behaviour**
A clear and concise description of the current behaviour when you do x. If completely new feature, leave empty.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here. If relevant please also provide version of the plugin and information on the system you are running it on.
14 changes: 14 additions & 0 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: code-style

on:
pull_request:
push:
branches: [master, main]

jobs:
code-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
release:
types: released

jobs:
plugin_dst:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8

# Needed if the plugin is using Transifex, to have the lrelease command
# - name: Install Qt lrelease
# run: sudo apt-get update && sudo apt-get install qt5-default qttools5-dev-tools

- name: Install qgis-plugin-ci
run: pip3 install qgis-plugin-ci

# When osgeo upload is wanted: --osgeo-username usrname --osgeo-password ${{ secrets.OSGEO_PASSWORD }}
# When Transifex is wanted: --transifex-token ${{ secrets.TRANSIFEX_TOKEN }}
- name: Deploy plugin
run: qgis-plugin-ci release ${GITHUB_REF/refs\/tags\//} --github-token ${{ secrets.GITHUB_TOKEN }} --disable-submodule-update
118 changes: 118 additions & 0 deletions .github/workflows/test-and-pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# workflow name
name: Tests

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the wanted branches
on:
pull_request:
push:
branches: [master, main]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
linux_tests:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
# Remove unsupported versions and add more versions. Use LTR version in the cov_tests job
docker_tags: [release-3_10, release-3_16, latest]
fail-fast: false

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
submodules: true

- name: Pull qgis
run: docker pull qgis/qgis:${{ matrix.docker_tags }}

# Runs all tests
- name: Run tests
run: >
docker run --rm --net=host --volume `pwd`:/app -w=/app -e QGIS_PLUGIN_IN_CI=1 qgis/qgis:${{ matrix.docker_tags }} sh -c
"pip3 install -qr requirements-dev.txt && xvfb-run -s '+extension GLX -screen 0 1024x768x24'
pytest -v --cov=arho_feature_template --cov-report=xml"
# Upload coverage report. Will not work if the repo is private
- name: Upload coverage to Codecov
if: ${{ matrix.docker_tags == 'latest' && !github.event.repository.private }}
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
fail_ci_if_error: false # set to true when upload is working
verbose: false

windows_tests:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Choco install qgis
uses: crazy-max/ghaction-chocolatey@v1
with:
args: install qgis-ltr -y

- name: Run tests
shell: pwsh
run: |
$env:PATH="C:\Program Files\QGIS 3.16\bin;$env:PATH"
$env:QGIS_PLUGIN_IN_CI=1
python-qgis-ltr.bat -m pip install -qr requirements-dev.txt
python-qgis-ltr.bat -m pytest -v
pre-release:
name: "Pre Release"
runs-on: "ubuntu-latest"
needs: [linux_tests, windows_tests]

steps:
- uses: hmarr/debug-action@v2

- uses: "marvinpinto/action-automatic-releases@latest"
if: ${{ github.event.pull_request }}
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "dev-pr"
prerelease: true
title: "Development Build made for PR #${{ github.event.number }}"

- uses: "marvinpinto/action-automatic-releases@latest"
if: ${{ github.event.after != github.event.before }}
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "dev"
prerelease: true
title: "Development Build made for master branch"

- uses: actions/checkout@v2
with:
submodules: true

- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8

# Needed if the plugin is using Transifex, to have the lrelease command
# - name: Install Qt lrelease
# run: sudo apt-get update && sudo apt-get install qt5-default qttools5-dev-tools

- name: Install qgis-plugin-ci
run: pip3 install qgis-plugin-ci

# When Transifex is wanted: --transifex-token ${{ secrets.TRANSIFEX_TOKEN }}
- name: Deploy plugin
if: ${{ github.event.pull_request }}
run: qgis-plugin-ci release dev-pr --github-token ${{ secrets.GITHUB_TOKEN }} --disable-submodule-update

# When Transifex is wanted: --transifex-token ${{ secrets.TRANSIFEX_TOKEN }}
- name: Deploy plugin
if: ${{ github.event.after != github.event.before }}
run: qgis-plugin-ci release dev --github-token ${{ secrets.GITHUB_TOKEN }} --disable-submodule-update
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
arho-feature-template/i18n
venv/
.venv/
start_ide.bat
.vscode
*/.pytest_cache
__pycache__
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "arho_feature_template/qgis_plugin_tools"]
path = arho_feature_template/qgis_plugin_tools
url = https://github.com/GispoCoding/qgis_plugin_tools
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.11
hooks:
# Run the linter.
- id: ruff
args: ["--extend-fixable=F841,F401"]
# Run the formatter.
- id: ruff-format
5 changes: 5 additions & 0 deletions .qgis-plugin-ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
plugin_path: arho_feature_template
github_organization_slug: GispoCoding
project_slug: arho-feature-template
transifex_coordinator: replace-me
transifex_organization: replace-me
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CHANGELOG



###
Loading

0 comments on commit ccb7179

Please sign in to comment.