[Qgis-user] Python Plugins and repos... HOWTO

Borys Jurgiel borysiasty at aster.pl
Mon Jun 15 15:43:37 PDT 2009


Monday 15 of June 2009 22:39:19 Sampson, David napisaƂ(a):
> Hey Folks,
> 
> Lots of info our there of how to get plugins FROM repos, but I can't
> find the info of how to create the XML needed to get your repo into the
> plugin installer.
> 
> I am sure it is a page on the wiki that just has not been linked.

Hi, such guidelines haven't been written yet. In general, there's still a lot to 
do with cleaning all the plugin policy & infrastructure.

Please remember the three most important rules:

1. The plugin versions in the repo XML and in the plugin __init__.py HAVE to 
match. In other case Installer can report the annoying fake possibility for 
upgrade, as it is now with the Image Boundary plugin


2. The directory name of an installed plugin and the zip file name of an 
available plugin are plugin idetifiers. This is essential for Plugin installer 
to be able to link an installed instance with an available one. In other case it 
shows two plugins: an available uninstalled plugin plus an installed orphan, 
instead of one installed and available plugin.

So the zip file name has to be exactly the same as the contained directory, plus 
the .zip extension. Strictly speaking, the zip file name only until the FIRST 
dot is considered as the plugin id. So it is possible to put various instances 
of the same plugin into one repository, by adding a suffix after a dot:

my_plugin.zip  ---> containing a directory: "my_plugin"
my_plugin.suffix.zip  ---> containing a directory: "my_plugin"
my_plugin.another_suffix.zip  ---> containing a directory: "my_plugin"

All the three plugins will be recoginzed as "my_plugin" and only one will be 
shown in the installer. Which one? 

The "best available". It means the one with the highest version number, suitable 
for the current QGIS version and not marked as 'experimental' if experimental 
plugins are currently not allowed. I'm not sure if I'm clear. If not, please 
don't hesitate to require a better explanation with an example ;) I'm just a bit 
sleepy now ;)

Btw. Please note that at the moment suffixes are allowed only in the zip file 
names, not in directory names!


3. ALWAYS download the commited plugin to test the package validity. Very often 
we commit a plugin without testing. And if something in the package is invalid, 
the source version works for author and the invalid package crashes for others.

> I have of course looked at and outright copied various XML's from the
> other repos... but now what?  How do I get the repo to be harvested when
> people want 3rd party plugins?

It's hardcoded in the plugin installer. So for now, please let me know the 
repository url and I'll add it. Later, we will have to find a more automated way 
of course. Unfortunately I'm completely busy until end of this month.

An idea most urgent to consider is to make the central contributed repository a 
'proxy' for other ones and let users to connect only to it. There are at least 
two reasons:

1. As there are more and more repositories to fetch, the QGIS start is going to 
be quite slowly. Also connection errors occur more often. 

2. Invalid plugins always happen, but repository admins are able to correct them 
or temporarily block only if they're in the central repos.

Goodnight :)
B.



More information about the Qgis-user mailing list