[Qgis-developer] Plugin requirements

Régis Haubourg regis.haubourg at gmail.com
Thu Dec 8 13:12:40 PST 2016


Thanks Arnaud, I use virtualenv also, but I understood in your message that
there was a way to combine it with osgeo4w packaging.
See you on monday
Régis

2016-12-08 18:01 GMT+01:00 Arnaud Morvan <arnaud.morvan at camptocamp.com>:

>
> virtualenv has nothing to do with osgeo4w
>
> virtualenv is a tool to create a site-package folder and install packages
> with pip.
> you use it in your make file (easy with linux, but should not be much more
> difficult under windows)
> you add it to your plugin package
> if you add this folder in your python path (sys.path.append) at runtime,
> python will find them.
>
> So virtualenv do not have to work in osgeo4w, you use it only at dev time.
>
> Arnaud Morvan
> Ingénieur logiciel
> Tél: +33 (0)4 58 48 20 32 <04%2058%2048%2020%2032>
>
> Camptocamp France SAS
> Savoie Technolac, BP 352
> 73377 Le Bourget du Lac Cedexhttp://www.camptocamp.com
>
> Le 08/12/2016 16:28, Régis Haubourg a écrit :
>
> Hi Arnaud,
> does virtualenv works in osgeo4w?
> Régis
>
> 2016-12-08 16:11 GMT+01:00 Arnaud Morvan <arnaud.morvan at camptocamp.com>:
>
>>
>> Hello Xavier,
>>
>> here we are used to create a virtualenv at build time (in make build or
>> make install target), in the plugin folder,
>> the virtual env site-package folder is added to the python sys path in
>> plugin __init__.py file before the class factory.
>>
>> Note that it is necessary to add this virtualenv to the plugin package
>> (in make package target for example).
>>
>> With this the plugin package can be big, but is self contained.
>>
>> Cheers
>>
>> Arnaud Morvan
>> Ingénieur logiciel
>> Tél: +33 (0)4 58 48 20 32
>>
>> Camptocamp France SAS
>> Savoie Technolac, BP 352
>> 73377 Le Bourget du Lac Cedex
>> http://www.camptocamp.com
>>
>>
>> Le 07/12/2016 15:22, Luigi Pirelli a écrit :
>>
>>> Hi Xavier
>>>
>>> 1) pip can be installed on OSGeo4W (many references on the gis stack
>>> exchange and on the web)
>>> 2) paver do nothing other than creating python eggs or now you can use
>>> wheel format, then setting pythonpath starting the plugin allow you to
>>> load module from local modules... paver is a utility to simplify
>>> packaging
>>>
>>> cheers
>>>
>>> Luigi Pirelli
>>>
>>> ************************************************************
>>> **************************************
>>> * Boundless QGIS Support/Development: lpirelli AT boundlessgeo DOT com
>>> * LinkedIn: https://www.linkedin.com/in/luigipirelli
>>> * Stackexchange: http://gis.stackexchange.com/users/19667/luigi-pirelli
>>> * GitHub: https://github.com/luipir
>>> * Mastering QGIS 2nd Edition:
>>> * https://www.packtpub.com/big-data-and-business-intelligence/
>>> mastering-qgis-second-edition
>>> ************************************************************
>>> **************************************
>>>
>>>
>>> On 7 December 2016 at 10:44, Xavier Barnada < <xbarnada at gisce.net>
>>> xbarnada at gisce.net> wrote:
>>>
>>>> Hi Alessandro,
>>>>
>>>> Thank you for the example, I will study paver to see how it works
>>>>
>>>> Cheers
>>>>
>>>> 2016-12-07 9:49 GMT+01:00 Alessandro Pasotti < <apasotti at gmail.com>
>>>> apasotti at gmail.com>:
>>>>
>>>>> On Wed, Dec 7, 2016 at 9:43 AM, Xavier Barnada <xbarnada at gisce.net>
>>>>> wrote:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> I been working on a plugin that uses another python requirements like
>>>>>> lxml.
>>>>>>
>>>>>> The problem it's that I solved the requirements problem on Linux
>>>>>> calling
>>>>>> pip command but this don't work on QGIS with Windows because Windows
>>>>>> don't
>>>>>> incorporate python or pip.
>>>>>>
>>>>>> In my opinion QGIS API should provide a way to install packages but i
>>>>>> supose that it's not so easy as I imagine.
>>>>>>
>>>>>> How do you use to solve this problem?  There is any example of it?  I
>>>>>> searched it on the documentation and don't appear any reference about
>>>>>> how to
>>>>>> do it.
>>>>>>
>>>>>> Best reggards
>>>>>> Xavier Barnada
>>>>>>
>>>>>>
>>>>>>
>>>>> Hi Xavier!
>>>>>
>>>>> We've considered adding a mechanism for plugin dependencies, (I've
>>>>> recently added a metadata for that purpose) but this seems a bit
>>>>> difficult
>>>>> to work cross-platform, BTW I'd be very happy to see some efforts in
>>>>> that
>>>>> area.
>>>>>
>>>>> What we normally do is to package and ship dependencies with the plugin
>>>>> itself, you can have a look to this example:
>>>>> https://github.com/boundlessgeo/qgis-geoserver-plugin/blob/m
>>>>> aster/pavement.py#L48
>>>>>
>>>>> Cheers.
>>>>>
>>>>> --
>>>>> Alessandro Pasotti
>>>>> w3:   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
>>>>
>>> _______________________________________________
>>> 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
>>>
>>
>> _______________________________________________
>> 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
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20161208/60c6c14a/attachment.html>


More information about the Qgis-developer mailing list