[Qgis-developer] standard way for custom plugin python dependencies

Vincent Picavet (ml) vincent.ml at oslandia.com
Thu Sep 22 06:22:01 PDT 2016


Hi,


On 22/09/2016 14:43, Alessandro Pasotti wrote:
> On Thu, Sep 22, 2016 at 2:37 PM, Akbar Gumbira <akbargumbira at gmail.com
> <mailto:akbargumbira at gmail.com>> wrote:
[..]
>     @Jachym: AFAIK, most plugins now just ship the needed libraries
>     along with it or ask the users to install them. There are some
>     libraries that are already shipped into QGIS from the core python
>     plugins (e.g jinja), you might want to check if what you need is
>     there already.
> 
> A new metadata (external_deps: text) field was introduced for this
> purpose but there is nothing implemented inside QGIS for now:
> https://github.com/qgis/QGIS-Django/commit/6546a2ab54fd01b6e94b921b610c31b619e99979#diff-536e872043014a84818f87dc640b2d4d
> 
> A common pattern seems shipping dependencies with the plugin as Python eggs.

New Python Wheels and Pypi now support binary packages. This becomes a
really useful and convenient tool to install dependencies, with
multi-platform support, without even having a compiler installed.

Making QGIS Python plugins as Python modules would allow to use all pip
and pypi insfrastructure really easily.

The proposed osgeo4w grant application by Jef could include the low
level required changes necessary to introduce this behaviour. Right now
pip is distributed by default in OSGeo4w, but since not all OSGeo4w
python modules are installed through pip (but through specific exe
installers), this may lead to installation problems ( names conflicts e.g.).

If this work is done, there still will be some work on the QGIS python
plugin interface, but _not_ reimplementing a package management system
in QGIS and use pip instead could be a good option.

Regards,
Vincent
> 
>  
> 
>     On Sep 22, 2016 19:14, "Matthias Kuhn" <matthias at opengis.ch
>     <mailto:matthias at opengis.ch>> wrote:
> 
>         Hi Jachym,
> 
>         Unfortunately not. This has been discussed and is something that
>         will
>         certainly be added at some point but so far nobody implemented it
>         (basically because of its cross-platform nature I think).
> 
>         Your possibilities are:
> 
>          * Document and print nice warnings
>          * Ship the dependency packaged with your plugin
>          * Fix it by adding dependency management in QGIS
> 
>         Cheers
>         Matthias
> 
>         On 09/22/2016 02:08 PM, Jachym Cepicky wrote:
>         > Hi all,
>         >
>         > we've developed an (python) plugin for QGIS, which is somehow
>         using
>         > (among others) nice "requests" python library. We use it the
>         standard way
>         >
>         > import requests
>         >
>         > But when we distributed the plugin to other computers, it
>         turned out,
>         > they do not have it installed.
>         >
>         > Is there any standard way, how to distribute dependencies
>         along with
>         > python plugin? Something in metadata.txt? Some requirements file?
>         >
>         > Thanks
>         >
>         > Jachym
>         >
>         >
>         > _______________________________________________
>         > Qgis-developer mailing list
>         > Qgis-developer at lists.osgeo.org
>         <mailto:Qgis-developer at lists.osgeo.org>
>         > List info:
>         http://lists.osgeo.org/mailman/listinfo/qgis-developer
>         <http://lists.osgeo.org/mailman/listinfo/qgis-developer>
>         > Unsubscribe:
>         http://lists.osgeo.org/mailman/listinfo/qgis-developer
>         <http://lists.osgeo.org/mailman/listinfo/qgis-developer>
>         >
>         _______________________________________________
>         Qgis-developer mailing list
>         Qgis-developer at lists.osgeo.org
>         <mailto:Qgis-developer at lists.osgeo.org>
>         List info:
>         http://lists.osgeo.org/mailman/listinfo/qgis-developer
>         <http://lists.osgeo.org/mailman/listinfo/qgis-developer>
>         Unsubscribe:
>         http://lists.osgeo.org/mailman/listinfo/qgis-developer
>         <http://lists.osgeo.org/mailman/listinfo/qgis-developer>
> 
> 
>     _______________________________________________
>     Qgis-developer mailing list
>     Qgis-developer at lists.osgeo.org <mailto:Qgis-developer at lists.osgeo.org>
>     List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>     <http://lists.osgeo.org/mailman/listinfo/qgis-developer>
>     Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>     <http://lists.osgeo.org/mailman/listinfo/qgis-developer>
> 
> 
> 
> 
> -- 
> Alessandro Pasotti
> w3:   www.itopen.it <http://www.itopen.it>
> 
> 
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 



More information about the Qgis-developer mailing list