Plugin Dependencies

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Plugin Dependencies

Guido Barbaglia
Dear all,

   I'm writing my first plugin for QGIS, which is basically a wrapper for some Python libraries I developed some times ago and that are available on the PyPi repository. How can I include these dependencies in my plugin? How can I configure the plugin so that it installs the dependencies when the user download the plugin itself?

Many thanks for your help, best
Guido 
--
Guido Barbaglia

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Plugin Dependencies

volaya
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,

Hope this  helps

2015-10-07 17:33 GMT+02:00 Guido Barbaglia <[hidden email]>:

> Dear all,
>
>    I'm writing my first plugin for QGIS, which is basically a wrapper for
> some Python libraries I developed some times ago and that are available on
> the PyPi repository. How can I include these dependencies in my plugin? How
> can I configure the plugin so that it installs the dependencies when the
> user download the plugin itself?
>
> Many thanks for your help, best
> Guido
> --
> Guido Barbaglia
> http://geobricks.org/
>
> _______________________________________________
> Qgis-developer mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Plugin Dependencies

Guido Barbaglia
Dear Victor,

   Many thanks for your help, I'll include my libs in the plugin then.


Best,
Guido

Il giorno 07 ott 2015, alle ore 17:50, Victor Olaya <[hidden email]> ha scritto:

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,

Hope this  helps

2015-10-07 17:33 GMT+02:00 Guido Barbaglia <[hidden email]>:
Dear all,

  I'm writing my first plugin for QGIS, which is basically a wrapper for
some Python libraries I developed some times ago and that are available on
the PyPi repository. How can I include these dependencies in my plugin? How
can I configure the plugin so that it installs the dependencies when the
user download the plugin itself?

Many thanks for your help, best
Guido
--
Guido Barbaglia
http://geobricks.org/

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Plugin Dependencies

Geo DrinX
In reply to this post by volaya
Ola Victor !  :)

2015-10-07 17:50 GMT+02:00 Victor Olaya <[hidden email]>:
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:
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


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Plugin Dependencies

volaya
The ext-libs folder is not in the repo. It is populated by the paver
setup task. Once you run the task, the libraries will be installed in
there

Hope this helps

2015-10-21 15:28 GMT+02:00 Geo DrinX <[hidden email]>:

> Ola Victor !  :)
>
> 2015-10-07 17:50 GMT+02:00 Victor Olaya <[hidden email]>:
>>
>> 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
>
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Plugin Dependencies

Geo DrinX
Thank you Victor for help.

I inserted your name in the header of my next "GEarthView.py 3.0 Cesium" source:

          import ext-libs        Enrico Ferreguti   
                                       Victor Olaya

With your help (and Enrico) I definitively solved  :)


A presto

Roberto


2015-10-24 15:26 GMT+02:00 Victor Olaya <[hidden email]>:
The ext-libs folder is not in the repo. It is populated by the paver
setup task. Once you run the task, the libraries will be installed in
there

Hope this helps

2015-10-21 15:28 GMT+02:00 Geo DrinX <[hidden email]>:
> Ola Victor !  :)
>
> 2015-10-07 17:50 GMT+02:00 Victor Olaya <[hidden email]>:
>>
>> 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
>


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Plugin Dependencies

Hugo Mercier
In reply to this post by volaya
Hi,

Related to this problematic (and not specific to processing), should the
future 3.0 version of QGIS be a good opportunity to review a little bit
the plugin management system ?

I am thinking of: using pip to manage plugins.

This would have some advantages :
- allow a plugin to depend on external packages and rely on pip
implementations on the different platforms to resolve dependencies
- this could also be used to have a plugin that depends on other plugins
- metadata could be integrated (rather than the current custom metadata.txt)
- possibly ease the deployment of plugins with binary parts (to be explored)
- ease the development of plugins with Python's virtualenv (say for
instance a stable and a "dev" virtualenv)
- use standard tools, both on client (pip) and server (pypi) part.

I am not sure yet if it would require an API break, but the version
change could be a good opportunity for a clean up.

Thoughts ?

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Plugin Dependencies

Geo DrinX
Sure, the problem of dependences needs to be solved in python QGIS.

But, in the meantime, sure (also) that I (or, better We of GEarthView team :) have solved.  Only, you need to wait my next GEarthView 3.0 version ( "Cesium" named :)

A presto !

Roberto

Inviato da iPhone

> Il giorno 26/ott/2015, alle ore 16:31, Hugo Mercier <[hidden email]> ha scritto:
>
> Hi,
>
> Related to this problematic (and not specific to processing), should the
> future 3.0 version of QGIS be a good opportunity to review a little bit
> the plugin management system ?
>
> I am thinking of: using pip to manage plugins.
>
> This would have some advantages :
> - allow a plugin to depend on external packages and rely on pip
> implementations on the different platforms to resolve dependencies
> - this could also be used to have a plugin that depends on other plugins
> - metadata could be integrated (rather than the current custom metadata.txt)
> - possibly ease the deployment of plugins with binary parts (to be explored)
> - ease the development of plugins with Python's virtualenv (say for
> instance a stable and a "dev" virtualenv)
> - use standard tools, both on client (pip) and server (pypi) part.
>
> I am not sure yet if it would require an API break, but the version
> change could be a good opportunity for a clean up.
>
> Thoughts ?
>
> _______________________________________________
> Qgis-developer mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Plugin Dependencies

Alessandro Pasotti-2
In reply to this post by Hugo Mercier
2015-10-26 16:31 GMT+01:00 Hugo Mercier <[hidden email]>:
Hi,

Related to this problematic (and not specific to processing), should the
future 3.0 version of QGIS be a good opportunity to review a little bit
the plugin management system ?

I am thinking of: using pip to manage plugins.

This would have some advantages :
- allow a plugin to depend on external packages and rely on pip
implementations on the different platforms to resolve dependencies
- this could also be used to have a plugin that depends on other plugins
- metadata could be integrated (rather than the current custom metadata.txt)
- possibly ease the deployment of plugins with binary parts (to be explored)
- ease the development of plugins with Python's virtualenv (say for
instance a stable and a "dev" virtualenv)
- use standard tools, both on client (pip) and server (pypi) part.

I am not sure yet if it would require an API break, but the version
change could be a good opportunity for a clean up.

Thoughts ?


Hello Hugo,

IMHO using  setuptools and pip it's a good idea, it does support download and install from several protocols (git included) out of the box, it also support dependencies and keywords licence tags, I'm not sure that it can support custom tags too, but it it's not so important.

I guess that most of the times, a plugin would not even need to be hosted by us on plugins.qgis.org but it could just be a git(hub) URI (with a big red warning to the the users that they are installing software from an external repository  etc. etc.).

I'm not sure about the support on other platforms, luckily (for me) I'm deeply ignorant about other OSes but it seems that windows users often have a lot of problems with installing and running python code: would pip/setuptools make things easier for them?

I don't understand completely what do you mean with the other points (virtualenvs and binary parts) can you elaborate?

--
Alessandro Pasotti
w3:   www.itopen.it

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Plugin Dependencies

Hugo Mercier
Hi Alessandro,

On 26/10/2015 17:50, Alessandro Pasotti wrote:

> Hello Hugo,
>
> IMHO using  setuptools and pip it's a good idea, it does support
> download and install from several protocols (git included) out of the
> box, it also support dependencies and keywords licence tags, I'm not
> sure that it can support custom tags too, but it it's not so important.
>
> I guess that most of the times, a plugin would not even need to be
> hosted by us on plugins.qgis.org <http://plugins.qgis.org> but it could
> just be a git(hub) URI (with a big red warning to the the users that
> they are installing software from an external repository  etc. etc.).

Exactly. That are interesting features.

>
> I'm not sure about the support on other platforms, luckily (for me) I'm
> deeply ignorant about other OSes but it seems that windows users often
> have a lot of problems with installing and running python code: would
> pip/setuptools make things easier for them?

Actually, this is the main concern I have with the current system: most
of the Windows users get their python environment through the QGIS
installer or osgeo4w. And if a plugin needs another dependency, it has
to be installed by other means.
Pip does exist for Windows and OSX and could act as a package manager
(where Linux users are usually happy with their distro package manager)

>
> I don't understand completely what do you mean with the other points
> (virtualenvs and binary parts) can you elaborate?

These are just ideas for now :) I don't have a strong experience with
these tools, so it would have to be confirmed.
But the idea is that if QGIS plugins are built with setuptools / pip,
then you can setup different virtualenvs with different sets of plugins
available in them. That may be interesting when dealing with different
user profiles or during development.

About binary parts: setuptools allows to insert compilation directives
if a module depends on C(++) parts. I don't know if this feature could
allow plugins with compiled parts ... the idea would be to include C(++)
sources with the plugin and have a standard way of compiling it, so that
it could be compiled by trusted sources on main platforms ... or by the
user if a standard compilation environment is present.
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Plugin Dependencies

Alessandro Pasotti-2
2015-10-26 18:16 GMT+01:00 Hugo Mercier <[hidden email]>:
Hi Alessandro,

On 26/10/2015 17:50, Alessandro Pasotti wrote:

> Hello Hugo,
>
> IMHO using  setuptools and pip it's a good idea, it does support
> download and install from several protocols (git included) out of the
> box, it also support dependencies and keywords licence tags, I'm not
> sure that it can support custom tags too, but it it's not so important.
>
> I guess that most of the times, a plugin would not even need to be
> hosted by us on plugins.qgis.org <http://plugins.qgis.org> but it could
> just be a git(hub) URI (with a big red warning to the the users that
> they are installing software from an external repository  etc. etc.).

Exactly. That are interesting features.

>
> I'm not sure about the support on other platforms, luckily (for me) I'm
> deeply ignorant about other OSes but it seems that windows users often
> have a lot of problems with installing and running python code: would
> pip/setuptools make things easier for them?

Actually, this is the main concern I have with the current system: most
of the Windows users get their python environment through the QGIS
installer or osgeo4w. And if a plugin needs another dependency, it has
to be installed by other means.
Pip does exist for Windows and OSX and could act as a package manager
(where Linux users are usually happy with their distro package manager)

>
> I don't understand completely what do you mean with the other points
> (virtualenvs and binary parts) can you elaborate?

These are just ideas for now :) I don't have a strong experience with
these tools, so it would have to be confirmed.
But the idea is that if QGIS plugins are built with setuptools / pip,
then you can setup different virtualenvs with different sets of plugins
available in them. That may be interesting when dealing with different
user profiles or during development.

About binary parts: setuptools allows to insert compilation directives
if a module depends on C(++) parts. I don't know if this feature could
allow plugins with compiled parts ... the idea would be to include C(++)
sources with the plugin and have a standard way of compiling it, so that
it could be compiled by trusted sources on main platforms ... or by the
user if a standard compilation environment is present.


Some random thoughts:

Quite powerful... but ... the current plugin packaging has very limited requirements: it's just a zipped folder with a couple of mandatory metadata and a class interface, building a simple plugin is definitely an easy task.

I'm afraid that by using a much more complicate system (such as setuptools), would solve some problem for the (few) complex plugins and create a lot of problems and increase the barrier for the vast majority of simpler plugin authors.

We should take this into account and think carefully.


--
Alessandro Pasotti
w3:   www.itopen.it

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Plugin Dependencies

Tim Sutton-5
hi

On 26 Oct 2015, at 19:28, Alessandro Pasotti <[hidden email]> wrote:

2015-10-26 18:16 GMT+01:00 Hugo Mercier <[hidden email]>:
Hi Alessandro,

On 26/10/2015 17:50, Alessandro Pasotti wrote:

> Hello Hugo,
>
> IMHO using  setuptools and pip it's a good idea, it does support
> download and install from several protocols (git included) out of the
> box, it also support dependencies and keywords licence tags, I'm not
> sure that it can support custom tags too, but it it's not so important.


We have discussed this in the past (I’ll try to find a reference in the mailing list archives) but note that using setup tools / pip has a couple of issues:

1) Expecting a compiler for cpython module compilation is unrealistic. Even if the compiler is there expecting the needed dev libs to be available is unrealistic. The simple approach to this is to bundle cpython using the approach described by Victor and use the dependency mechanism for pure python modules only. 
2) What happens when plugin A tries to install Raven==4.0 and plugin B wants to install Raven==5.0? Plugins will end up trampling over each other dependencies and breaking each other. The solution for that is to use a virtualenv per plugin and expose the QGIS libs into the virtual env. But then we have a problem (maybe its ok?) that plugins cannot depend on each other and import each other’s packages.

I must say I like the idea of having stuff installed into virtualenvs. I’m not so sure about uploading the plugins themselves to pip - I can see the attraction of that but it also adds another layer of overhead for people starting out with plugin development. 

Regards

Tim


>
> I guess that most of the times, a plugin would not even need to be
> hosted by us on plugins.qgis.org <http://plugins.qgis.org> but it could
> just be a git(hub) URI (with a big red warning to the the users that
> they are installing software from an external repository  etc. etc.).

Exactly. That are interesting features.

>
> I'm not sure about the support on other platforms, luckily (for me) I'm
> deeply ignorant about other OSes but it seems that windows users often
> have a lot of problems with installing and running python code: would
> pip/setuptools make things easier for them?

Actually, this is the main concern I have with the current system: most
of the Windows users get their python environment through the QGIS
installer or osgeo4w. And if a plugin needs another dependency, it has
to be installed by other means.
Pip does exist for Windows and OSX and could act as a package manager
(where Linux users are usually happy with their distro package manager)

>
> I don't understand completely what do you mean with the other points
> (virtualenvs and binary parts) can you elaborate?

These are just ideas for now :) I don't have a strong experience with
these tools, so it would have to be confirmed.
But the idea is that if QGIS plugins are built with setuptools / pip,
then you can setup different virtualenvs with different sets of plugins
available in them. That may be interesting when dealing with different
user profiles or during development.

About binary parts: setuptools allows to insert compilation directives
if a module depends on C(++) parts. I don't know if this feature could
allow plugins with compiled parts ... the idea would be to include C(++)
sources with the plugin and have a standard way of compiling it, so that
it could be compiled by trusted sources on main platforms ... or by the
user if a standard compilation environment is present.


Some random thoughts:

Quite powerful... but ... the current plugin packaging has very limited requirements: it's just a zipped folder with a couple of mandatory metadata and a class interface, building a simple plugin is definitely an easy task.

I'm afraid that by using a much more complicate system (such as setuptools), would solve some problem for the (few) complex plugins and create a lot of problems and increase the barrier for the vast majority of simpler plugin authors.

We should take this into account and think carefully.


-- 
Alessandro Pasotti
w3:   www.itopen.it
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer



Tim Sutton
QGIS Project Steering Committee Member





_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Plugin Dependencies

Richard Duivenvoorde
On 05-11-15 04:56, Tim Sutton wrote:

>> Some random thoughts:
>>
>> Quite powerful... but ... the current plugin packaging has very
>> limited requirements: it's just a zipped folder with a couple of
>> mandatory metadata and a class interface, building a simple plugin is
>> definitely an easy task.
>>
>> I'm afraid that by using a much more complicate system (such as
>> setuptools), would solve some problem for the (few) complex plugins
>> and create a lot of problems and increase the barrier for the vast
>> majority of simpler plugin authors.

I agree with Tim, unless we come up with a very simple way, this will
not solve the problem: "non tech savvy users cannot setup their python
environment for some complex plugi".

The different module versions problem I do not see as a practical
problem, most times python can work with higher versions. Let's keep it
the responsibility of the plugin builders to keep up with versions of
their modules.
I still think just copy the modules into the plugin is easiest (although
redundant).
And if you cannot package the lib with your plugin because of OS
problems: documentation is the answer...

Somebody with this insights, maybe can write a chapter about python path
magics and how QGIS works with that?

Regards,

Richard

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Plugin Dependencies

Vincent Picavet (ml)
Hello,

On 05/11/2015 09:50, Richard Duivenvoorde wrote:

> On 05-11-15 04:56, Tim Sutton wrote:
>[...]
>>> I'm afraid that by using a much more complicate system (such as
>>> setuptools), would solve some problem for the (few) complex plugins
>>> and create a lot of problems and increase the barrier for the vast
>>> majority of simpler plugin authors.
>
> I agree with Tim, unless we come up with a very simple way, this will
> not solve the problem: "non tech savvy users cannot setup their python
> environment for some complex plugi".

You are right, but this should be taken the other way round : how do we
add sugar onto a powerful system, to make it accessible for
non-that-tech people.
This is clearly doable and would be an ideal solution.
The proposals from Victor and all to create a set of functions to help
writing plugins is already a good start in that direction for the code part.
We should be able to do the same for the development environment part.

I think there are much more end-users which are annoyed by dependency
problems than new plugin writers not willing to setup en environment.
Dependency problems are hard whatever we do, and we should definitely
rely on the experience of others for this.



> The different module versions problem I do not see as a practical
> problem, most times python can work with higher versions. Let's keep it
> the responsibility of the plugin builders to keep up with versions of
> their modules.

Yes the plugin versions dependencies should be left to the plugin
writer. Dealing with one application using various versions of a module
for various plugins will just lead to "DLL Hell", multiple duplication
of modules and behaviour inconsistencies for the end user.

I think we should build on top of well-defined and bullet-proof tools
the Python world has to offer, and focus on adding simple ways for a
newcomer to start with development. It is not a question of overhead, it
is a question of interface.

Vincent

> I still think just copy the modules into the plugin is easiest (although
> redundant).
> And if you cannot package the lib with your plugin because of OS
> problems: documentation is the answer...
>
> Somebody with this insights, maybe can write a chapter about python path
> magics and how QGIS works with that?
>
> Regards,
>
> Richard
>
> _______________________________________________
> Qgis-developer mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Plugin Dependencies

Tim Sutton-6
In reply to this post by Richard Duivenvoorde
Hi

On 05 Nov 2015, at 10:50, Richard Duivenvoorde <[hidden email]> wrote:

On 05-11-15 04:56, Tim Sutton wrote:
Some random thoughts:

Quite powerful... but ... the current plugin packaging has very
limited requirements: it's just a zipped folder with a couple of
mandatory metadata and a class interface, building a simple plugin is
definitely an easy task.

I'm afraid that by using a much more complicate system (such as
setuptools), would solve some problem for the (few) complex plugins
and create a lot of problems and increase the barrier for the vast
majority of simpler plugin authors.





I agree with Tim, unless we come up with a very simple way, this will
not solve the problem: "non tech savvy users cannot setup their python
environment for some complex plug”.


Just a note that the comments above are from Ale, not from me…

Regards

Tim

The different module versions problem I do not see as a practical
problem, most times python can work with higher versions. Let's keep it
the responsibility of the plugin builders to keep up with versions of
their modules.
I still think just copy the modules into the plugin is easiest (although
redundant).
And if you cannot package the lib with your plugin because of OS
problems: documentation is the answer...

Somebody with this insights, maybe can write a chapter about python path
magics and how QGIS works with that?

Regards,

Richard

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer






Tim Sutton

Visit http://kartoza.com to find out about open source:

* Desktop GIS programming services
* Geospatial web development
* GIS Training
* Consulting Services

Skype: timlinux Irc: timlinux on #qgis at freenode.net
Tim is a member of the QGIS Project Steering Committee

Kartoza is a merger between Linfiniti and Afrispatial


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer

signature.asc (465 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Plugin Dependencies

Richard Duivenvoorde
In reply to this post by Hugo Mercier
On 26-10-15 15:31, Hugo Mercier wrote:
> Hi,
>
> Related to this problematic (and not specific to processing), should the
> future 3.0 version of QGIS be a good opportunity to review a little bit
> the plugin management system ?
>
> I am thinking of: using pip to manage plugins.

I created two feature requests, to see if including pip in the windows
and mac installer is feasible:

http://hub.qgis.org/issues/13775

http://hub.qgis.org/issues/13777

Regards,

Richard
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Plugin Dependencies

stbrunner
Hello,

Some additional informations :-)

Plugin to create a static pypi index:
https://pypi.python.org/pypi/magnum-pi

Plgins to create a full pypi service:
Some package that we usually have issue And I think that should be include on QGIS windows install:
psycopg2
Shapely
Pillow


CU
Stéph

2015-11-06 13:50 GMT+01:00 Richard Duivenvoorde <[hidden email]>:
On 26-10-15 15:31, Hugo Mercier wrote:
> Hi,
>
> Related to this problematic (and not specific to processing), should the
> future 3.0 version of QGIS be a good opportunity to review a little bit
> the plugin management system ?
>
> I am thinking of: using pip to manage plugins.

I created two feature requests, to see if including pip in the windows
and mac installer is feasible:

http://hub.qgis.org/issues/13775

http://hub.qgis.org/issues/13777

Regards,

Richard
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer



--

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer