How to use new QGIS plugins repository

24.01.2012 21:03 ·  GIS  ·  qgis, plugins, howto

With the release of QGIS 1.7.0 it was announced that a new official plugin repository has been created with many features (a rating system, lists of recommended and recently added plugins, etc.). In addition, a dedicated section for 3rd-party plugins has been created in the QGIS bug tracker, where plugin authors can create a homepage, wiki, bug tracker, and code repository for their plugins. The main goal of all this is to provide a single repository for plugins and a single place to report bugs for both plugins and QGIS itself.

And although the new repository has been put into production and added as the default repository in the QGIS 1.9.90, plugin developers are still holding back on using it (at the time of writing, there are only 35 plugins in the new repository, for comparison, there are 111 plugins in the old repository). This can probably be explained partly by ignorance and partly by the somewhat confusing procedure for adding a plugin to the new repository.

Let’s try to figure this out.

I assume that the plugin code has been published to one of the public code repositories, such as GitHub or BitBucket, and now we want to set up a bug tracker and wiki on hub.qgis.org. This will make life a bit easier for users: they will be able to use their existing account to file bug reports. To do this:

The bug tracker and code repository are ready. All we need to do now is upload the plugin to the plugins repository.

Before creating an archive and uploading it to the server, we need to fill in the metadata in the plugin’s metadata.txt file, specifying the URLs of the bugtracker, repository and homepage (more details). Here’s an example:

[general]
name = Cool Plugin
description = Does some useful actions with your data
category = Vector
version = 1.0.0
qgisMinimumVersion = 1.7.2
icon = icons/pluginicon.png
authorName=username
tags=vector, bounding box, buffer
experimental = True
deprecated = False
homepage = http://someserver.com/coolplugin.html
tracker = http://hub.qgis.org/projects/coolplugin
repository = http://github.com/username/coolplugin

Save the changes in the metadata.txt file and create an archive with the plugin. Now we are ready to upload the plugin to the new repository:

If the plugin is packaged correctly and the metadata contains no errors, the archive will be uploaded to the server. Otherwise, an error message is displayed, and the upload is cancelled. Once the errors have been corrected, the upload should be repeated.

The uploaded plugin gets an unapproved status and is not immediately available to all users. It will only be added to the list of publicly available plugins after approval from the administrator. This will happen every time you upload a new version, even if your plugin has already been approved. This policy may be changed in the future.

There is also a small script to upload the plugin archive to the server. For example, you can add it to the post-commit hook or Makefile and upload new versions without a browser.

As you can see, there is nothing complicated about using the new infrastructure.

⮜ Prev
Next ⮞