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

2016-09-23 Thread dmarteau
I cannot aggree more with Vincent !

I would add than supporting python virtualenvs could be a solution to the
package distribution problems under Windows. 




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/standard-way-for-custom-plugin-python-dependencies-tp5287268p5287411.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

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

2016-09-22 Thread Tom Kralidis


Jachym: fwiw request is included in master and release-2_16 branches 
respectively [1].

Having said this, a more streamlined approach to plugin management in QGIS
would make things much easier for long term support across distributions.

..Tom

[1] https://github.com/qgis/QGIS/tree/master/python/ext-libs

On Thu, 22 Sep 2016, Luigi Pirelli wrote:


Date: Thu, 22 Sep 2016 17:01:51 +0200
From: Luigi Pirelli <lui...@gmail.com>
To: Jachym Cepicky <jachym.cepi...@gmail.com>
Cc: "qgis-developer@lists.osgeo.org" <qgis-developer@lists.osgeo.org>
Subject: Re: [Qgis-developer] standard way for custom plugin python
dependencies

why not package critical/missing dep with the plugin itself? import
from local egg only if not present in the installation.
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:
https://www.packtpub.com/application-development/mastering-qgis
**


On 22 September 2016 at 14:08, Jachym Cepicky <jachym.cepi...@gmail.com> 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@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@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@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

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

2016-09-22 Thread Luigi Pirelli
why not package critical/missing dep with the plugin itself? import
from local egg only if not present in the installation.
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:
https://www.packtpub.com/application-development/mastering-qgis
**


On 22 September 2016 at 14:08, 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@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@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

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

2016-09-22 Thread Alessandro Pasotti
On Thu, Sep 22, 2016 at 3:22 PM, Vincent Picavet (ml) <
vincent...@oslandia.com> wrote:

> Hi,
>
>
> On 22/09/2016 14:43, Alessandro Pasotti wrote:
> > On Thu, Sep 22, 2016 at 2:37 PM, Akbar Gumbira  > > 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.
>


I could't agree more!

We definitely don't want to re-invent the (PyPi) wheel ;)

Go for pip, but still the external_deps field in metadata could be useful
to hold the content of REQUIREMENTS.txt, or a path to it.

-- 
Alessandro Pasotti
w3:   www.itopen.it
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

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

2016-09-22 Thread Vincent Picavet (ml)
Hi,


On 22/09/2016 14:43, Alessandro Pasotti wrote:
> On Thu, Sep 22, 2016 at 2:37 PM, Akbar Gumbira  > 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"  > 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@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@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@lists.osgeo.org 
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 
> 
> 
> 
> 
> -- 
> Alessandro Pasotti
> w3:   www.itopen.it 
> 
> 
> ___
> Qgis-developer mailing list
> Qgis-developer@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@lists.osgeo.org
List info: 

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

2016-09-22 Thread Alessandro Pasotti
On Thu, Sep 22, 2016 at 2:37 PM, Akbar Gumbira 
wrote:

> Hi Matthias,
>
> Is there any pointer to the discussion? If it's possible for me to help, I
> could may be make a proposal for next year GSoC on this :)
>
>
Nice idea!

Please go ahead :)


> @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.



> On Sep 22, 2016 19:14, "Matthias Kuhn"  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@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@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@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 
Alessandro Pasotti
w3:   www.itopen.it
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

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

2016-09-22 Thread Akbar Gumbira
Hi Matthias,

Is there any pointer to the discussion? If it's possible for me to help, I
could may be make a proposal for next year GSoC on this :)

@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.

On Sep 22, 2016 19:14, "Matthias Kuhn"  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@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@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@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

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

2016-09-22 Thread Matthias Kuhn
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@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@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

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

2016-09-22 Thread Jachym Cepicky
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@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer