Releasing your plugin

警告

Despite our constant efforts, information beyond this line may not be updated for QGIS 3. Refer to https://qgis.org/pyqgis/master for the python API documentation or, give a hand to update the chapters you know about. Thanks.

プラグインの準備ができ、そのプラグインが誰かのために役立つことあると思ったら、躊躇わずに Official Python plugin repository にアップロードしてください。そのページでは、プラグインのインストーラでうまく動作するプラグインを準備する方法についてパッケージ化のガイドラインがあります。あるいは、独自のプラグインのリポジトリを設定したい場合は、プラグインとそのメタデータの一覧を表示する単純なXMLファイルを作成してください。

Please take special care to the following suggestions:

Metadata and names

  • avoid using a name too similar to existing plugins

  • if your plugin has a similar functionality to an existing plugin, please explain the differences in the About field, so the user will know which one to use without the need to install and test it

  • avoid repeating "plugin" in the name of the plugin itself

  • use the description field in metadata for a 1 line description, the About field for more detailed instructions

  • コードリポジトリ、バグトラッカー、およびホーム・ページを含めてください。これは非常に協働作業の可能性を向上させますし、利用可能なWebインフラストラクチャの1つ(GitHub、GitLab、Bitbucketなど)で非常に簡単に行うことができます

  • タグは注意して選択してください:情報価値のないもの(例:ベクター)を避け、すでに他のユーザーによって使用されているもの(プラグインのWebサイトを参照)を選んでください

  • add a proper icon, do not leave the default one; see QGIS interface for a suggestion of the style to be used

Code and help

  • do not include generated file (ui_*.py, resources_rc.py, generated help files…) and useless stuff (e.g. .gitignore) in repository

  • add the plugin to the appropriate menu (Vector, Raster, Web, Database)

  • 適切な場合(解析を実行するプラグイン)、処理フレームワークのサブプラグインとしてプラグインを追加することを検討してください:これによってユーザーはバッチでそれを実行し、より複雑なワークフローにそれを統合できるようになり、インターフェイスを設計する負担がなくなります

  • 最低限の文書を、そしてテストと理解に役立つ場合はサンプルデータを含めてください。

Official Python plugin repository

You can find the official Python plugin repository at https://plugins.qgis.org/.

In order to use the official repository you must obtain an OSGEO ID from the OSGEO web portal.

Once you have uploaded your plugin it will be approved by a staff member and you will be notified.

TODO:

Insert a link to the governance document

Permissions

These rules have been implemented in the official plugin repository:

  • every registered user can add a new plugin

  • staff users can approve or disapprove all plugin versions

  • users which have the special permission plugins.can_approve get the versions they upload automatically approved

  • users which have the special permission plugins.can_approve can approve versions uploaded by others as long as they are in the list of the plugin owners

  • a particular plugin can be deleted and edited only by staff users and plugin owners

  • if a user without plugins.can_approve permission uploads a new version, the plugin version is automatically unapproved.

Trust management

Staff members can grant trust to selected plugin creators setting plugins.can_approve permission through the front-end application.

The plugin details view offers direct links to grant trust to the plugin creator or the plugin owners.

Validation

Plugin's metadata are automatically imported and validated from the compressed package when the plugin is uploaded.

Here are some validation rules that you should aware of when you want to upload a plugin on the official repository:

  1. プラグインを含むメインフォルダの名前は、ASCII文字(A-Zおよびa-z)、数字、アンダースコア(_)とマイナス( - )しか含んではならず、また数字で始めることはできません。

  2. metadata.txt is required

  3. all required metadata listed in metadata table must be present

  4. the version metadata field must be unique

Plugin structure

Following the validation rules the compressed (.zip) package of your plugin must have a specific structure to validate as a functional plugin. As the plugin will be unzipped inside the users plugins folder it must have it's own directory inside the .zip file to not interfere with other plugins. Mandatory files are: metadata.txt and __init__.py. But it would be nice to have a README and of course an icon to represent the plugin (resources.qrc). Following is an example of how a plugin.zip should look like.

plugin.zip
  pluginfolder/
  |-- i18n
  |   |-- translation_file_de.ts
  |-- img
  |   |-- icon.png
  |   `-- iconsource.svg
  |-- __init__.py
  |-- Makefile
  |-- metadata.txt
  |-- more_code.py
  |-- main_code.py
  |-- README
  |-- resources.qrc
  |-- resources_rc.py
  `-- ui_Qt_user_interface_file.ui