[Gfoss] Fwd: [Qgis-developer] Plugin Dependencies

Geo DrinX geodrinx a gmail.com
Gio 22 Ott 2015 09:01:46 CEST


Salve a tutti,

qualcuno sa come si risolve il problema delle librerie esterne richieste
dai plugin ?

Dove vanno inserite ?   Si possono inserire all'interno del plugin, invece
di doverle inserire all'interno di ogni nuova versione di QGIS, come ad
esempio :

QGIS VERSIONE\apps\Python27\Lib\site-packages\

?

A proposito di questo, di seguito c'è il messaggio di Victor Olaya che ho
trovato all'interno della lista qgis-dev ,  ma non riesco a far funzionare
le sue istruzioni.   Qualcuno può aiutarmi ?  :)    Penso sia un problema
che interessa parecchi sviluppatori di plugin.


Grazie per qualunque info in proposito

A presto

Roberto


---------- Forwarded message ----------
From: Geo DrinX <geodrinx a gmail.com>
Date: 2015-10-21 15:28 GMT+02:00
Subject: Re: [Qgis-developer] Plugin Dependencies
To: Victor Olaya <volayaf a gmail.com>
Cc: qgis-developer <qgis-developer a lists.osgeo.org>


Ola Victor !  :)

2015-10-07 17:50 GMT+02:00 Victor Olaya <volayaf a gmail.com>:

> At the moment, you have to ship them with your plugin, in the plugin
> zip file. If the lib uses native code, you will need to include
> binaries for all OSs that you want to support, and the corresponding
> mechanism to pick one or the other.
>
> As an example, you can see how it is done in this plugin
>
>
> https://github.com/boundlessgeo/qgis-geoserver-plugin/blob/master/src/geoserverexplorer/__init__.py
>
> Dependencies are stored in a folder called "ext-libs", which is added
> to the python path by the plugin
>
> Notice that that folder is not in the repo, there is a paver task to
> fetch the dependencies from PyPi
>
> Notice also that QGIS has its folder with python libs
>
> https://github.com/qgis/QGIS/tree/master/python/ext-libs
>
> Make sure that the libs you require are not already in there



In my case ( GEarthView QGIS plugin )  I have  two external libraries:

twisted
zope


that I need to install manually  :(

On windows,  they need to be copied for each new version of QGIS, inside
the folder:

QGIS VERSION\apps\Python27\Lib\site-packages\


Instead, on MacOSX, they are  (once and for all) inside the standard
python  library folder, as I explained in my blog:

http://exporttocanoma.blogspot.it/2015/01/gearthview-20-plugin-per-qgis.html


I have tried several times to make sure that it was not necessary to
install anything, including the libraries in my plugins, so far I have not
succeeded.   So, that your message has rekindled my hopes  :)    but there
are some things I do not understand, in your explanation  (my fault).

Here are my steps:

1) I modified my  geodrinx/__init__.py      adding:

site.addsitedir(os.path.abspath(os.path.dirname(__file__) + '/ext-libs'))

Question:  where need I to create this  ext-libs   folder ?    I looked
into the plugin that you indicate, but I found no "ext-libs" folder.

Could you please explain me (us)  better ?


Thank you much

A presto

Roberto
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lists.gfoss.it/pipermail/gfoss/attachments/20151022/a11e3cef/attachment-0001.html>


Maggiori informazioni sulla lista Gfoss