Skip to content

Commit 44c391c

Browse files
authored
Merge pull request #21 from GispoCoding/update-project-structure
Update project structure
2 parents d9527fd + 6918a8f commit 44c391c

File tree

144 files changed

+1862
-17657
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+1862
-17657
lines changed

.editorconfig

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
charset = utf-8
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
9+
[*.py]
10+
indent_style = space
11+
indent_size = 4
12+
13+
[*.ui]
14+
indent_style = space
15+
indent_size = 2
16+
max_line_length = 100000
17+
18+
[*.md]
19+
trim_trailing_whitespace = false

.flake8

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[flake8]
2+
# Black compatible values https://black.readthedocs.io/en/stable/compatible_configs.html#flake8
3+
max-line-length = 88
4+
extend-ignore =
5+
E203, # whitespace before ':'
6+
ANN101 # Missing type annotation for self in method

.github/workflows/code-style.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master, main]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-python@v2
14+
- uses: pre-commit/[email protected]

.github/workflows/tests.yml

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# workflow name
2+
name: Tests
3+
4+
# Controls when the action will run. Triggers the workflow on push or pull request
5+
# events but only for the wanted branches
6+
on:
7+
pull_request:
8+
push:
9+
branches: [master, main]
10+
11+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
12+
jobs:
13+
linux_tests:
14+
# The type of runner that the job will run on
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
# Remove unsupported versions and add more versions. Use LTR version in the cov_tests job
19+
docker_tags: [release-3_10, release-3_16, latest]
20+
fail-fast: false
21+
22+
# Steps represent a sequence of tasks that will be executed as part of the job
23+
steps:
24+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
25+
- uses: actions/checkout@v2
26+
with:
27+
submodules: true
28+
29+
- name: Pull qgis
30+
run: docker pull qgis/qgis:${{ matrix.docker_tags }}
31+
32+
# Runs all tests
33+
- name: Run tests
34+
run: >
35+
docker run --rm --net=host --volume `pwd`:/app -w=/app -e QGIS_PLUGIN_IN_CI=1 qgis/qgis:${{ matrix.docker_tags }} sh -c
36+
"pip3 install -qr requirements-dev.txt && xvfb-run -s '+extension GLX -screen 0 1024x768x24'
37+
pytest -v --cov=nlsgpkgloader --cov-report=xml"
38+
39+
# Upload coverage report. Will not work if the repo is private
40+
- name: Upload coverage to Codecov
41+
if: ${{ matrix.docker_tags == 'latest' && !github.event.repository.private }}
42+
uses: codecov/codecov-action@v1
43+
with:
44+
file: ./coverage.xml
45+
flags: unittests
46+
fail_ci_if_error: false # set to true when upload is working
47+
verbose: false
48+
49+
windows_tests:
50+
runs-on: windows-latest
51+
52+
steps:
53+
- uses: actions/checkout@v2
54+
with:
55+
submodules: true
56+
57+
- name: Choco install qgis
58+
uses: crazy-max/ghaction-chocolatey@v1
59+
with:
60+
args: install qgis-ltr -y
61+
62+
- name: Run tests
63+
shell: pwsh
64+
run: |
65+
$env:PATH="C:\Program Files\QGIS 3.16\bin;$env:PATH"
66+
$env:QGIS_PLUGIN_IN_CI=1
67+
python-qgis-ltr.bat -m pip install -qr requirements-dev.txt
68+
python-qgis-ltr.bat -m pytest -v
69+
70+
pre-release:
71+
name: "Pre Release"
72+
runs-on: "ubuntu-latest"
73+
needs: [linux_tests, windows_tests]
74+
75+
steps:
76+
- uses: hmarr/debug-action@v2
77+
78+
- uses: "marvinpinto/action-automatic-releases@latest"
79+
if: ${{ github.event.pull_request }}
80+
with:
81+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
82+
automatic_release_tag: "dev-pr"
83+
prerelease: true
84+
title: "Development Build made for PR #${{ github.event.number }}"
85+
86+
- uses: "marvinpinto/action-automatic-releases@latest"
87+
if: ${{ github.event.after != github.event.before }}
88+
with:
89+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
90+
automatic_release_tag: "dev"
91+
prerelease: true
92+
title: "Development Build made for master branch"
93+
94+
- uses: actions/checkout@v2
95+
with:
96+
submodules: true
97+
98+
- name: Set up Python 3.8
99+
uses: actions/setup-python@v1
100+
with:
101+
python-version: 3.8
102+
103+
# Needed if the plugin is using Transifex, to have the lrelease command
104+
# - name: Install Qt lrelease
105+
# run: sudo apt-get update && sudo apt-get install qt5-default qttools5-dev-tools
106+
107+
- name: Install qgis-plugin-ci
108+
run: pip3 install qgis-plugin-ci
109+
110+
# When Transifex is wanted: --transifex-token ${{ secrets.TRANSIFEX_TOKEN }}
111+
- name: Deploy plugin
112+
if: ${{ github.event.pull_request }}
113+
run: qgis-plugin-ci release dev-pr --github-token ${{ secrets.GITHUB_TOKEN }} --disable-submodule-update
114+
115+
# When Transifex is wanted: --transifex-token ${{ secrets.TRANSIFEX_TOKEN }}
116+
- name: Deploy plugin
117+
if: ${{ github.event.after != github.event.before }}
118+
run: qgis-plugin-ci release dev --github-token ${{ secrets.GITHUB_TOKEN }} --disable-submodule-update

.gitignore

+138-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,138 @@
1-
.vscode/*
2-
help/build
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
98+
__pypackages__/
99+
100+
# Celery stuff
101+
celerybeat-schedule
102+
celerybeat.pid
103+
104+
# SageMath parsed files
105+
*.sage.py
106+
107+
# Environments
108+
.env
109+
.venv
110+
env/
111+
venv/
112+
ENV/
113+
env.bak/
114+
venv.bak/
115+
116+
# Spyder project settings
117+
.spyderproject
118+
.spyproject
119+
120+
# Rope project settings
121+
.ropeproject
122+
123+
# mkdocs documentation
124+
/site
125+
126+
# mypy
127+
.mypy_cache/
128+
.dmypy.json
129+
dmypy.json
130+
131+
# Pyre type checker
132+
.pyre/
133+
134+
# pytype static type analyzer
135+
.pytype/
136+
137+
# Cython debug symbols
138+
cython_debug/

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "nlsgpkgloader/qgis_plugin_tools"]
2+
path = nlsgpkgloader/qgis_plugin_tools
3+
url = https://github.com/GispoCoding/qgis_plugin_tools.git

.pre-commit-config.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.0.1
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- repo: https://github.com/PyCQA/isort
12+
rev: 5.9.3
13+
hooks:
14+
- id: isort
15+
- repo: https://github.com/psf/black
16+
rev: 21.7b0
17+
hooks:
18+
- id: black
19+
- repo: https://github.com/PyCQA/flake8
20+
rev: 3.9.2
21+
hooks:
22+
- id: flake8
23+
additional_dependencies:
24+
- flake8-bugbear~=21.4.3
25+
- pep8-naming~=0.12.1
26+
- flake8-qgis>=0.1.4

.qgis-plugin-ci

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
plugin_path: nlsgpkgloader
2+
github_organization_slug: GispoCoding
3+
project_slug: NLSgpkgloader
4+
transifex_coordinator: replace-me
5+
transifex_organization: replace-me

LICENCE

-1
Original file line numberDiff line numberDiff line change
@@ -672,4 +672,3 @@ may consider it more useful to permit linking proprietary applications with
672672
the library. If this is what you want to do, use the GNU Lesser General
673673
Public License instead of this License. But first, please read
674674
<https://www.gnu.org/licenses/why-not-lgpl.html>.
675-

0 commit comments

Comments
 (0)