Skip to content

Commit

Permalink
Merge pull request #251 from QGIS-Contribution/packaging/qgis-plugin-ci
Browse files Browse the repository at this point in the history
Packaging: use QGIS Plugin CI
  • Loading branch information
Guts authored Apr 28, 2022
2 parents d98e127 + 352e106 commit 78f156a
Show file tree
Hide file tree
Showing 23 changed files with 122 additions and 151 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ ENV/
.venv/*

# embedded libs
# ext_libs/bin
# ext_libs/docs
# ext_libs/*/contrib/
# ext_libs/*/tests/
ext_libs/
dev_precommit_black.log
*.zip
172 changes: 83 additions & 89 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,143 +1,137 @@
# CHANGELOG

<!--
The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).

## 1.0.0
## 1.0.0-beta1 - 2022-04-28

### Added
- Improved integration of external libraries (#166)
- Improved development environment (#168) - thanks to @Guts

### Changed
## 0.16.0 - 2020-08-29

### Fixed
- GUI improvements (#138, #139, #140, #141)
- Add button for reloading the QGIS directory of approved resources (#145)
- Fix bug in the handling of QGIS directory updates (#146)
- Add support for checklists (#151) - @ricardogsilva

----
---

-->
## 0.15.1 - 2020-05-16

## 0.16.0
- Fix incorrect handling of searchPathsForSVG setting (#135)
- Handle XML parsing exceptions for QML files\*0.15.0 - Support expressions (#130). Switch to Python pathlib.

* GUI improvements (#138, #139, #140, #141)
* Add button for reloading the QGIS directory of approved resources (#145)
* Fix bug in the handling of QGIS directory updates (#146)
* Add support for checklists (#151) - @ricardogsilva
---

----
## 0.14.1 - 2020-04-25

## 0.15.1
- Also support QGIS 3.4 (avoid install of style labelsettings and textformatting for v. < 3.10 - #127)
- Try another way to avoid [WinError 5] on Microsoft Windows (#103)

* Fix incorrect handling of searchPathsForSVG setting (#135)
* Handle XML parsing exceptions for QML files*0.15.0 - Support expressions (#130). Switch to Python pathlib.
---

----
## 0.14.0 - 2020-04-23

## 0.14.1
- Style import improvements (fix colorramp support, add support for label settings and text formats, clean up Style Manager tags) (#113, #114, #116, #118)
- Change collection directory names from a hash to a more user friendly name (composition of the name of the collection and its repository) (#110)
- Preserve the installed collections when renaming a repository (#121)
- Documentation updates (#105, #109, #113)

* Also support QGIS 3.4 (avoid install of style labelsettings and textformatting for v. < 3.10 - #127)
* Try another way to avoid [WinError 5] on Microsoft Windows (#103)
---

----
## 0.13.1 - 2020-04-11

## 0.14.0
- Fix #44 (files removed from repository are still being installed from cache)

* Style import improvements (fix colorramp support, add support for label settings and text formats, clean up Style Manager tags) (#113, #114, #116, #118)
* Change collection directory names from a hash to a more user friendly name (composition of the name of the collection and its repository) (#110)
* Preserve the installed collections when renaming a repository (#121)
* Documentation updates (#105, #109, #113)
---

----
## 0.13.0 - 2020-04-10

## 0.13.1
- GUI updates (#100)
- Provide installation summary (#6)
- Avoid (parent) tag with no members in QGIS 3 style documents (#101)
- Fix reloading problems ([WinError 5]) with Microsoft Windows (#103)
- Other minor issues (#104)

* Fix #44 (files removed from repository are still being installed from cache)
---

----
## 0.12.0 - 2020-03-28

## 0.13.0
- Make font sizes OK on HiDPI systems (#3)
- Disable editing and removal of "official" repositories in Settings (#93)
- Avoid ResourceWarning when installing a collection (#95)
- Stop using the collection name for naming directories (#99)
- Fixed parsing metadata issue - byte decoding (#41)
- Update dulwich to v0.19.15
- Update of bootstrap to v4.4.1
- Update jquery to v3.4.1

* GUI updates (#100)
* Provide installation summary (#6)
* Avoid (parent) tag with no members in QGIS 3 style documents (#101)
* Fix reloading problems ([WinError 5]) with Microsoft Windows (#103)
* Other minor issues (#104)
---

----
## 0.11.1 - 2020-03-03

## 0.12.0 - Make font sizes OK on HiDPI systems (#3)
- Reduce log level to avoid exception on missing name or URL in directory (#64)

* Disable editing and removal of "official" repositories in Settings (#93)
* Avoid ResourceWarning when installing a collection (#95)
* Stop using the collection name for naming directories (#99)
* Fixed parsing metadata issue - byte decoding (#41)
* Update dulwich to v0.19.15
* Update of bootstrap to v4.4.1
* Update jquery to v3.4.1
---

----
## 0.11.0 - 2020-02-29

## 0.11.1
- Check for missing repository name and URL in directory (#64)
- Correct link to documentation

* Reduce log level to avoid exception on missing name or URL in directory (#64)
---

----
## 0.10.0 - 2020-02-26

## 0.11.0
- Added support for Processing models (#42)
- Make the plugin available from the web menu (#68)
- Fixing log message levels (#71)
- Add the action to the toolbar (#70)
- Avoid breaking when collections with incompatible QGIS versions are encountered (#60)
- Avoid [WinErr 32] (#80)

* Check for missing repository name and URL in directory (#64)
* Correct link to documentation
---

----
## 0.9.0 - 2020-02-15

## 0.10.0
- Added support for R scripts (#57)

* Added support for Processing models (#42)
* Make the plugin available from the web menu (#68)
* Fixing log message levels (#71)
* Add the action to the toolbar (#70)
* Avoid breaking when collections with incompatible QGIS versions are encountered (#60)
* Avoid [WinErr 32] (#80)
---

----
## 0.8.0 - 2020-02-10

## 0.9.0
- Fix issue #59 (deleting repositories does not work)

* Added support for R scripts (#57)
---

----
## 0.7.0 - 2020-02-07

## 0.8.0
- Flip experimental flag
- Merge PR from havatv (issue #60 - avoid breaking on incompatible versions)

* Fix issue #59 (deleting repositories does not work)
---

----
## 0.6.0 - 2018-12-04

## 0.7.0
- Experimental version for QGIS 3

* Flip experimental flag
* Merge PR from havatv (issue #60 - avoid breaking on incompatible versions)
---

----
## 0.5.2 - 2017-11-05

## 0.6.0
- Add support for gitlab and gogs repositories (PR by Salvatore Larosa - gh username: slarosa)

* Experimental version for QGIS 3
---

----
## 0.5.1 - 2016-08-31

## 0.5.2
- Allow authors to add license details in the collection
- Fixed problem in QGIS < 2.12 as a result of using the new QgsAuthManager
- Change the behavior of updating and removing directory in settings (This fixed #34)
- Use the new official QGIS resource repository (https://github.com/qgis/QGIS-Resources)

* Add support for gitlab and gogs repositories (PR by Salvatore Larosa - gh username: slarosa)
---

----
## 0.5.0 - 2016-08-15

## 0.5.1

* Allow authors to add license details in the collection
* Fixed problem in QGIS < 2.12 as a result of using the new QgsAuthManager
* Change the behavior of updating and removing directory in settings (This fixed #34)
* Use the new official QGIS resource repository (https://github.com/qgis/QGIS-Resources)

----

## 0.5.0

* Wohooo first release!
- Wohooo first release!
2 changes: 2 additions & 0 deletions docs/development/history.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```{include} ../../CHANGELOG.md
```
22 changes: 22 additions & 0 deletions docs/development/packaging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Packaging and deployment

## Packaging

This plugin is using the [qgis-plugin-ci](https://github.com/opengisch/qgis-plugin-ci/) tool to perform packaging operations.
The package command is performing a `git archive` run based on changelog.

```bash
# package a specific version (which must be already documented in the changelog)
qgis-plugin-ci package 1.3.1
# package latest version
qgis-plugin-ci package latest
```

## Release a version

Everything is done through the continuous deployment:

1. Add the new version to the `CHANGELOG.md`
1. Change the version number in `__about__.py`
1. Apply a git tag with the relevant version: `git tag -a 0.3.0 {git commit hash} -m "This version rocks!"`
1. Push tag to main branch: `git push origin 0.3.0`
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,7 @@ development/contributing
development/environment
development/update_dependencies
development/documentation
development/packaging
development/release-workflow
development/history
```
4 changes: 4 additions & 0 deletions requirements/packaging.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Packaging
# ---------

qgis-plugin-ci>=2.3,<2.4
52 changes: 1 addition & 51 deletions resource_sharing/metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ icon=resources/icon.png
tags=algorithm,checklist,collection,design,map,model,processing,Python,R,repository,resource,script,sharing,style,svg,symbol

# credits and contact
email=[email protected]
email=[email protected]
author=Akbar Gumbira, Håvard Tveite, Julien Moura
homepage=https://qgis-contribution.github.io/QGIS-ResourceSharing/
repository=https://github.com/QGIS-Contribution/QGIS-ResourceSharing/
Expand All @@ -20,53 +20,3 @@ qgisMaximumVersion=3.98
experimental=False
deprecated=False
changelog=
0.17.0 - Improved integration of external libraries (#166)
- Improved development environment (#168) -thanks to @Guts
0.16.0 - GUI improvements (#138, #139, #140, #141)
- Add button for reloading the QGIS directory of approved resources (#145 ) - thanks to @Guts
- Fix bug in the handling of QGIS directory updates (#146)
- Add support for checklists (#151) - @ricardogsilva
0.15.1 - Fix incorrect handling of searchPathsForSVG setting (#135)
- Handle XML parsing exceptions for QML files
0.15.0 - Support expressions (#130). Switch to Python pathlib.
0.14.1 - Also support QGIS 3.4 (avoid install of style labelsettings and textformatting for v. < 3.10 - #127)
- Try another way to avoid [WinError 5] on Microsoft Windows (#103)
0.14.0 - Style import improvements (fix colorramp support, add support for label settings and text formats, clean up Style Manager tags) (#113, #114, #116, #118)
- Change collection directory names from a hash to a more user friendly name (composition of the name of the collection and its repository) (#110)
- Preserve the installed collections when renaming a repository (#121)
- Documentation updates (#105, #109, #113)
0.13.1 - Fix #44 (files removed from repository are still being installed from cache)
0.13.0 - GUI updates (#100)
- Provide installation summary (#6)
- Avoid (parent) tag with no members in QGIS 3 style documents (#101)
- Fix reloading problems ([WinError 5]) with Microsoft Windows (#103)
- Other minor issues (#104)
0.12.0 - Make font sizes OK on HiDPI systems (#3)
- Disable editing and removal of "official" repositories in Settings (#93)
- Avoid ResourceWarning when installing a collection (#95)
- Stop using the collection name for naming directories (#99)
- Fixed parsing metadata issue - byte decoding (#41)
- Update dulwich to v0.19.15
- Update of bootstrap to v4.4.1
- Update jquery to v3.4.1
0.11.1 - Reduce log level to avoid exception on missing name or URL in directory (#64)
0.11.0 - Check for missing repository name and URL in directory (#64)
- Correct link to documentation
0.10.0 - Added support for Processing models (#42)
- Make the plugin available from the web menu (#68)
- Allow specification of the file system location of the local collections folder (#51)
- Fixing log message levels (#71)
- Add the action to the toolbar (#70)
- Avoid breaking when collections with incompatible QGIS versions are encountered (#60)
- Avoid [WinErr 32] (#80)
0.9.0 - Added support for R scripts (#57)
0.8.0 - Fix issue #59 (deleting repositories does not work)
0.7.0 - Flip experimental flag
- Merge PR from havatv (issue #60 - avoid breaking on incompatible versions)
0.6.0 - Experimental version for QGIS 3
0.5.2 - Add support for gitlab and gogs repositories (PR by Salvatore Larosa - gh username: slarosa)
0.5.1 - Allow authors to add license details in the collection
0.5.1 - Fixed problem in QGIS < 2.12 as a result of using the new QgsAuthManager
0.5.1 - Change the behavior of updating and removing directory in settings (This fixed #34)
0.5.1 - Use the new official QGIS resource repository (https://github.com/qgis/QGIS-Resources)
0.5.0 - Wohooo first release!
5 changes: 3 additions & 2 deletions resource_sharing/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
except ImportError:
from qgis.PyQt.QtWidgets import QAction # QT 5

from resource_sharing.__about__ import __icon_path__

from .gui.resource_sharing_dialog import ResourceSharingDialog
from .utilities import resources_path

Expand Down Expand Up @@ -164,9 +166,8 @@ def add_action(
def initGui(self):
"""Create the menu entries and toolbar icons inside the QGIS GUI."""

icon_path = str(resources_path("icon.png"))
self.add_action(
icon_path,
icon_path=str(__icon_path__.resolve()),
text=self.tr("Resource Sharing"),
callback=self.run,
parent=self.iface.mainWindow(),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 4 additions & 5 deletions resource_sharing/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import jinja2

from resource_sharing import config
from resource_sharing.__about__ import DIR_PLUGIN_ROOT

LOGGER = logging.getLogger("QGIS Resource Sharing")

Expand All @@ -39,8 +40,7 @@ def resources_path(*args):
:return: Absolute path to the resources folder.
:rtype: Path
"""
path = Path(__file__).parent.parent
path = path / "resources"
path = DIR_PLUGIN_ROOT / "resources"
for item in args:
path = path / item
return path
Expand Down Expand Up @@ -170,16 +170,15 @@ def qgis_version():
return version


def render_template(filename, context):
def render_template(filename, context) -> dict:
"""Render a template with the specified filename.
:param filename: The filename (must be in the template directory)
:type filename: str
:param context: The context passed for the template
:type context: dict
"""
path = Path(__file__).parent
path = Path(path).parent / "resources" / "template"
path = DIR_PLUGIN_ROOT / "resources" / "template"
return (
jinja2.Environment(loader=jinja2.FileSystemLoader(str(path)))
.get_template(filename)
Expand Down

0 comments on commit 78f156a

Please sign in to comment.