Re: [Qgis-developer] Managing Python dependencies automatically for the user

2016-01-15 Thread Luigi Pirelli
e.g.
http://stackoverflow.com/questions/14050281/how-to-check-if-a-python-module-exists-without-importing-it

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 15 January 2016 at 13:24, Luigi Pirelli  wrote:

> btw an exception can be caouse by other dependencies of openpyxl => better
> to check the correct exception than a generic one
>
> 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 15 January 2016 at 13:23, Luigi Pirelli  wrote:
>
>> thank you for sharing
>>
>> 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 15 January 2016 at 12:12, Pablo Fernández Moniz <
>> [email protected]> wrote:
>>
>>> First of all, thank you very much for all the fast replies, they have
>>> been very helpful for us.
>>>
>>>  The solution we finally implemented was adding the .egg file for the
>>> dependency and loading it when the wider system import fails in the
>>> following fashion:
>>>
>>> import os
>>> import sys
>>>
>>> try:
>>> import openpyxl
>>> except:
>>> package_name = "openpyxl-2.3.2-py2.7.egg"
>>> package_path = os.path.join(os.path.dirname(__file__), package_name)
>>> sys.path.append(package_path)
>>> import openpyxl
>>>
>>>  This may not be a solution for every use case but it gets the job done
>>> for us in our setup.
>>>
>>>  Once again, thank you for he fast replies and ideas given.
>>>
>>>  Kind regards,
>>>
>>> 2016-01-15 4:40 GMT+00:00 Andreas Neumann :
>>>
 Note that the Windows binaries already contain xlwt and xlrd. Jürgen
 was so kind to include it, because I needed it as well for my plugins. Not
 sure about openpyxl. On Linux systems it is rather easy to install them
 through apt-get, pip or similar mechanisms. Just tell your users that/how
 they need/can install them.

 Andreas


 On 14.01.2016 22:13, Matthias Kuhn wrote:

 Hi Pablo, Tim

 On 01/14/2016 10:00 PM, Tim Sutton wrote:

 Hi

 On 14 Jan 2016, at 18:06, Pablo Fernández Moniz <
 [email protected]> wrote:

 Hi!

  We are currently developing a QGIS plugin were we wish to generate
 some Excel files as output.

  In order to build the spreadsheet file we need to use some python
 modules installed from pip (openpyxl, xlwt, etc). This dependency will
 force every user to manually install the needed package form the pip
 repository.

  This situation leaves us with the following question: is possible or
 it will be in the future to manage this kind of dependencies from QGIS side
 when the user installs the plugin?


 Although it has been discussed and some prototyping was done to support
 automatic installation of dependencies at the last hackfest, there isn’t
 anything in the released versions of QGIS to support this yet. If your
 packages have no operating system specific binaries in them, then I suggest
 to bundle them into your plugin and use an appropriate import path relative
 to your code. Note there is a limit on how big your plugin can be (I think
 it is 10mb) so you need to ensure your 3rd party deps do not bulk out your
 plugin too much.


 We bundled xlwt and xlrd as .egg with a plugin recently:

 https://github.com/opengisch/shpsync/blob/master/xlwt-1.0.0-py2.7.egg
 https://github.com/opengisch/shpsync/blob/master/xlrd-0.9.4-py2.7.egg

 Until there's a cross-platform dependency management (which I know that

Re: [Qgis-developer] Managing Python dependencies automatically for the user

2016-01-15 Thread Luigi Pirelli
btw an exception can be caouse by other dependencies of openpyxl => better
to check the correct exception than a generic one

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 15 January 2016 at 13:23, Luigi Pirelli  wrote:

> thank you for sharing
>
> 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 15 January 2016 at 12:12, Pablo Fernández Moniz <
> [email protected]> wrote:
>
>> First of all, thank you very much for all the fast replies, they have
>> been very helpful for us.
>>
>>  The solution we finally implemented was adding the .egg file for the
>> dependency and loading it when the wider system import fails in the
>> following fashion:
>>
>> import os
>> import sys
>>
>> try:
>> import openpyxl
>> except:
>> package_name = "openpyxl-2.3.2-py2.7.egg"
>> package_path = os.path.join(os.path.dirname(__file__), package_name)
>> sys.path.append(package_path)
>> import openpyxl
>>
>>  This may not be a solution for every use case but it gets the job done
>> for us in our setup.
>>
>>  Once again, thank you for he fast replies and ideas given.
>>
>>  Kind regards,
>>
>> 2016-01-15 4:40 GMT+00:00 Andreas Neumann :
>>
>>> Note that the Windows binaries already contain xlwt and xlrd. Jürgen was
>>> so kind to include it, because I needed it as well for my plugins. Not sure
>>> about openpyxl. On Linux systems it is rather easy to install them through
>>> apt-get, pip or similar mechanisms. Just tell your users that/how they
>>> need/can install them.
>>>
>>> Andreas
>>>
>>>
>>> On 14.01.2016 22:13, Matthias Kuhn wrote:
>>>
>>> Hi Pablo, Tim
>>>
>>> On 01/14/2016 10:00 PM, Tim Sutton wrote:
>>>
>>> Hi
>>>
>>> On 14 Jan 2016, at 18:06, Pablo Fernández Moniz <
>>> [email protected]> wrote:
>>>
>>> Hi!
>>>
>>>  We are currently developing a QGIS plugin were we wish to generate some
>>> Excel files as output.
>>>
>>>  In order to build the spreadsheet file we need to use some python
>>> modules installed from pip (openpyxl, xlwt, etc). This dependency will
>>> force every user to manually install the needed package form the pip
>>> repository.
>>>
>>>  This situation leaves us with the following question: is possible or it
>>> will be in the future to manage this kind of dependencies from QGIS side
>>> when the user installs the plugin?
>>>
>>>
>>> Although it has been discussed and some prototyping was done to support
>>> automatic installation of dependencies at the last hackfest, there isn’t
>>> anything in the released versions of QGIS to support this yet. If your
>>> packages have no operating system specific binaries in them, then I suggest
>>> to bundle them into your plugin and use an appropriate import path relative
>>> to your code. Note there is a limit on how big your plugin can be (I think
>>> it is 10mb) so you need to ensure your 3rd party deps do not bulk out your
>>> plugin too much.
>>>
>>>
>>> We bundled xlwt and xlrd as .egg with a plugin recently:
>>>
>>> https://github.com/opengisch/shpsync/blob/master/xlwt-1.0.0-py2.7.egg
>>> https://github.com/opengisch/shpsync/blob/master/xlrd-0.9.4-py2.7.egg
>>>
>>> Until there's a cross-platform dependency management (which I know that
>>> several people are looking into) that's the safest road to follow.
>>>
>>> Best
>>>
>>> Matthias
>>>
>>>
>>> Regards
>>>
>>> Tim
>>>
>>>
>>>  Thank you for your time!
>>>
>>>  Kind regards.
>>>
>>> --
>>>
>>> Pablo Fernández Moniz
>>> GIT Analyst
>>>
>>> Web Linkedin
>>>    Twitter
>>> 
>>> ___
>>> Qgis-developer mailing list
>>> [email protected]
>>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>>
>>>
>>> —
>>>
>>>
>>>
>>>
>>> Tim Sutton
>>>
>>> Visit  http://kartoza.com to find out about open
>>> source:
>>>
>>> * Desktop GIS 

Re: [Qgis-developer] Managing Python dependencies automatically for the user

2016-01-15 Thread Luigi Pirelli
thank you for sharing

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 15 January 2016 at 12:12, Pablo Fernández Moniz <
[email protected]> wrote:

> First of all, thank you very much for all the fast replies, they have been
> very helpful for us.
>
>  The solution we finally implemented was adding the .egg file for the
> dependency and loading it when the wider system import fails in the
> following fashion:
>
> import os
> import sys
>
> try:
> import openpyxl
> except:
> package_name = "openpyxl-2.3.2-py2.7.egg"
> package_path = os.path.join(os.path.dirname(__file__), package_name)
> sys.path.append(package_path)
> import openpyxl
>
>  This may not be a solution for every use case but it gets the job done
> for us in our setup.
>
>  Once again, thank you for he fast replies and ideas given.
>
>  Kind regards,
>
> 2016-01-15 4:40 GMT+00:00 Andreas Neumann :
>
>> Note that the Windows binaries already contain xlwt and xlrd. Jürgen was
>> so kind to include it, because I needed it as well for my plugins. Not sure
>> about openpyxl. On Linux systems it is rather easy to install them through
>> apt-get, pip or similar mechanisms. Just tell your users that/how they
>> need/can install them.
>>
>> Andreas
>>
>>
>> On 14.01.2016 22:13, Matthias Kuhn wrote:
>>
>> Hi Pablo, Tim
>>
>> On 01/14/2016 10:00 PM, Tim Sutton wrote:
>>
>> Hi
>>
>> On 14 Jan 2016, at 18:06, Pablo Fernández Moniz <
>> [email protected]> wrote:
>>
>> Hi!
>>
>>  We are currently developing a QGIS plugin were we wish to generate some
>> Excel files as output.
>>
>>  In order to build the spreadsheet file we need to use some python
>> modules installed from pip (openpyxl, xlwt, etc). This dependency will
>> force every user to manually install the needed package form the pip
>> repository.
>>
>>  This situation leaves us with the following question: is possible or it
>> will be in the future to manage this kind of dependencies from QGIS side
>> when the user installs the plugin?
>>
>>
>> Although it has been discussed and some prototyping was done to support
>> automatic installation of dependencies at the last hackfest, there isn’t
>> anything in the released versions of QGIS to support this yet. If your
>> packages have no operating system specific binaries in them, then I suggest
>> to bundle them into your plugin and use an appropriate import path relative
>> to your code. Note there is a limit on how big your plugin can be (I think
>> it is 10mb) so you need to ensure your 3rd party deps do not bulk out your
>> plugin too much.
>>
>>
>> We bundled xlwt and xlrd as .egg with a plugin recently:
>>
>> https://github.com/opengisch/shpsync/blob/master/xlwt-1.0.0-py2.7.egg
>> https://github.com/opengisch/shpsync/blob/master/xlrd-0.9.4-py2.7.egg
>>
>> Until there's a cross-platform dependency management (which I know that
>> several people are looking into) that's the safest road to follow.
>>
>> Best
>>
>> Matthias
>>
>>
>> Regards
>>
>> Tim
>>
>>
>>  Thank you for your time!
>>
>>  Kind regards.
>>
>> --
>>
>> Pablo Fernández Moniz
>> GIT Analyst
>>
>> Web Linkedin
>>    Twitter
>> 
>> ___
>> Qgis-developer mailing list
>> [email protected]
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: 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 [email protected]
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>>
>> --
>> Matthias Kuhn
>> OPENGIS.ch - https://www.opengis.ch
>> Spatial • (Q)GIS • PostGIS • Open Source
>>
>>
>>
>> ___
>> Qgis-developer mailing [email protected]
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: http

Re: [Qgis-developer] Managing Python dependencies automatically for the user

2016-01-15 Thread Pablo Fernández Moniz
First of all, thank you very much for all the fast replies, they have been
very helpful for us.

 The solution we finally implemented was adding the .egg file for the
dependency and loading it when the wider system import fails in the
following fashion:

import os
import sys

try:
import openpyxl
except:
package_name = "openpyxl-2.3.2-py2.7.egg"
package_path = os.path.join(os.path.dirname(__file__), package_name)
sys.path.append(package_path)
import openpyxl

 This may not be a solution for every use case but it gets the job done for
us in our setup.

 Once again, thank you for he fast replies and ideas given.

 Kind regards,

2016-01-15 4:40 GMT+00:00 Andreas Neumann :

> Note that the Windows binaries already contain xlwt and xlrd. Jürgen was
> so kind to include it, because I needed it as well for my plugins. Not sure
> about openpyxl. On Linux systems it is rather easy to install them through
> apt-get, pip or similar mechanisms. Just tell your users that/how they
> need/can install them.
>
> Andreas
>
>
> On 14.01.2016 22:13, Matthias Kuhn wrote:
>
> Hi Pablo, Tim
>
> On 01/14/2016 10:00 PM, Tim Sutton wrote:
>
> Hi
>
> On 14 Jan 2016, at 18:06, Pablo Fernández Moniz <
> [email protected]> wrote:
>
> Hi!
>
>  We are currently developing a QGIS plugin were we wish to generate some
> Excel files as output.
>
>  In order to build the spreadsheet file we need to use some python modules
> installed from pip (openpyxl, xlwt, etc). This dependency will force every
> user to manually install the needed package form the pip repository.
>
>  This situation leaves us with the following question: is possible or it
> will be in the future to manage this kind of dependencies from QGIS side
> when the user installs the plugin?
>
>
> Although it has been discussed and some prototyping was done to support
> automatic installation of dependencies at the last hackfest, there isn’t
> anything in the released versions of QGIS to support this yet. If your
> packages have no operating system specific binaries in them, then I suggest
> to bundle them into your plugin and use an appropriate import path relative
> to your code. Note there is a limit on how big your plugin can be (I think
> it is 10mb) so you need to ensure your 3rd party deps do not bulk out your
> plugin too much.
>
>
> We bundled xlwt and xlrd as .egg with a plugin recently:
>
> https://github.com/opengisch/shpsync/blob/master/xlwt-1.0.0-py2.7.egg
> https://github.com/opengisch/shpsync/blob/master/xlrd-0.9.4-py2.7.egg
>
> Until there's a cross-platform dependency management (which I know that
> several people are looking into) that's the safest road to follow.
>
> Best
>
> Matthias
>
>
> Regards
>
> Tim
>
>
>  Thank you for your time!
>
>  Kind regards.
>
> --
>
> Pablo Fernández Moniz
> GIT Analyst
>
> Web Linkedin
>    Twitter
> 
> ___
> Qgis-developer mailing list
> [email protected]
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: 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 [email protected]
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
> --
> Matthias Kuhn
> OPENGIS.ch - https://www.opengis.ch
> Spatial • (Q)GIS • PostGIS • Open Source
>
>
>
> ___
> Qgis-developer mailing [email protected]
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>
> ___
> Qgis-developer mailing list
> [email protected]
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 

Pablo Fernández Moniz
GIT Analyst

Web Linkedin
   Twitter

___
Qgis-developer mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Managing Python dependencies automatically for the user

2016-01-14 Thread Andreas Neumann
Note that the Windows binaries already contain xlwt and xlrd. Jürgen was 
so kind to include it, because I needed it as well for my plugins. Not 
sure about openpyxl. On Linux systems it is rather easy to install them 
through apt-get, pip or similar mechanisms. Just tell your users 
that/how they need/can install them.


Andreas

On 14.01.2016 22:13, Matthias Kuhn wrote:

Hi Pablo, Tim

On 01/14/2016 10:00 PM, Tim Sutton wrote:

Hi

On 14 Jan 2016, at 18:06, Pablo Fernández Moniz 
> wrote:


Hi!

 We are currently developing a QGIS plugin were we wish to generate 
some Excel files as output.


 In order to build the spreadsheet file we need to use some python 
modules installed from pip (openpyxl, xlwt, etc). This dependency 
will force every user to manually install the needed package form 
the pip repository.


 This situation leaves us with the following question: is possible 
or it will be in the future to manage this kind of dependencies from 
QGIS side when the user installs the plugin?


Although it has been discussed and some prototyping was done to 
support automatic installation of dependencies at the last hackfest, 
there isn’t anything in the released versions of QGIS to support this 
yet. If your packages have no operating system specific binaries in 
them, then I suggest to bundle them into your plugin and use an 
appropriate import path relative to your code. Note there is a limit 
on how big your plugin can be (I think it is 10mb) so you need to 
ensure your 3rd party deps do not bulk out your plugin too much.


We bundled xlwt and xlrd as .egg with a plugin recently:

https://github.com/opengisch/shpsync/blob/master/xlwt-1.0.0-py2.7.egg
https://github.com/opengisch/shpsync/blob/master/xlrd-0.9.4-py2.7.egg

Until there's a cross-platform dependency management (which I know 
that several people are looking into) that's the safest road to follow.


Best

Matthias



Regards

Tim



 Thank you for your time!

 Kind regards.

--

Pablo Fernández Moniz
GIT Analyst

Web  Linkedin 
 Twitter 


___
Qgis-developer mailing list
[email protected] 
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: 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
[email protected]
List info:http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe:http://lists.osgeo.org/mailman/listinfo/qgis-developer


--
Matthias Kuhn
OPENGIS.ch -https://www.opengis.ch
Spatial • (Q)GIS • PostGIS • Open Source


___
Qgis-developer mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer


___
Qgis-developer mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Managing Python dependencies automatically for the user

2016-01-14 Thread Luigi Pirelli
Boundless plugins uses paver to automatize egg generation and inclusion in
the plugin script... you can find an example in the qgis-geoserver-explorer
plugin source code on github. In the plugin code you can find all the
setting to import plugin included eggs.

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:
https://www.packtpub.com/application-development/mastering-qgis
**

On 14 January 2016 at 22:13, Matthias Kuhn  wrote:

> Hi Pablo, Tim
>
> On 01/14/2016 10:00 PM, Tim Sutton wrote:
>
> Hi
>
> On 14 Jan 2016, at 18:06, Pablo Fernández Moniz <
> [email protected]> wrote:
>
> Hi!
>
>  We are currently developing a QGIS plugin were we wish to generate some
> Excel files as output.
>
>  In order to build the spreadsheet file we need to use some python modules
> installed from pip (openpyxl, xlwt, etc). This dependency will force every
> user to manually install the needed package form the pip repository.
>
>  This situation leaves us with the following question: is possible or it
> will be in the future to manage this kind of dependencies from QGIS side
> when the user installs the plugin?
>
>
> Although it has been discussed and some prototyping was done to support
> automatic installation of dependencies at the last hackfest, there isn’t
> anything in the released versions of QGIS to support this yet. If your
> packages have no operating system specific binaries in them, then I suggest
> to bundle them into your plugin and use an appropriate import path relative
> to your code. Note there is a limit on how big your plugin can be (I think
> it is 10mb) so you need to ensure your 3rd party deps do not bulk out your
> plugin too much.
>
>
> We bundled xlwt and xlrd as .egg with a plugin recently:
>
> https://github.com/opengisch/shpsync/blob/master/xlwt-1.0.0-py2.7.egg
> https://github.com/opengisch/shpsync/blob/master/xlrd-0.9.4-py2.7.egg
>
> Until there's a cross-platform dependency management (which I know that
> several people are looking into) that's the safest road to follow.
>
> Best
>
> Matthias
>
>
>
> Regards
>
> Tim
>
>
>  Thank you for your time!
>
>  Kind regards.
>
> --
>
> Pablo Fernández Moniz
> GIT Analyst
>
> Web Linkedin
>    Twitter
> 
> ___
> Qgis-developer mailing list
> [email protected]
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: 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 [email protected]
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
> --
> Matthias Kuhn
> OPENGIS.ch - https://www.opengis.ch
> Spatial • (Q)GIS • PostGIS • Open Source
>
>
> ___
> Qgis-developer mailing list
> [email protected]
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
___
Qgis-developer mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Managing Python dependencies automatically for the user

2016-01-14 Thread Matthias Kuhn
Hi Pablo, Tim

On 01/14/2016 10:00 PM, Tim Sutton wrote:
> Hi
>
>> On 14 Jan 2016, at 18:06, Pablo Fernández Moniz
>> > > wrote:
>>
>> Hi!
>>
>>  We are currently developing a QGIS plugin were we wish to generate
>> some Excel files as output. 
>>
>>  In order to build the spreadsheet file we need to use some python
>> modules installed from pip (openpyxl, xlwt, etc). This dependency
>> will force every user to manually install the needed package form the
>> pip repository.
>>
>>  This situation leaves us with the following question: is possible or
>> it will be in the future to manage this kind of dependencies from
>> QGIS side when the user installs the plugin? 
>
> Although it has been discussed and some prototyping was done to
> support automatic installation of dependencies at the last hackfest,
> there isn’t anything in the released versions of QGIS to support this
> yet. If your packages have no operating system specific binaries in
> them, then I suggest to bundle them into your plugin and use an
> appropriate import path relative to your code. Note there is a limit
> on how big your plugin can be (I think it is 10mb) so you need to
> ensure your 3rd party deps do not bulk out your plugin too much.

We bundled xlwt and xlrd as .egg with a plugin recently:

https://github.com/opengisch/shpsync/blob/master/xlwt-1.0.0-py2.7.egg
https://github.com/opengisch/shpsync/blob/master/xlrd-0.9.4-py2.7.egg

Until there's a cross-platform dependency management (which I know that
several people are looking into) that's the safest road to follow.

Best

Matthias

>
> Regards
>
> Tim
>
>>
>>  Thank you for your time! 
>>
>>  Kind regards.
>>
>> -- 
>>
>> Pablo Fernández Moniz
>> GIT Analyst
>>
>> Web Linkedin
>>    Twitter
>> 
>> ___
>> Qgis-developer mailing list
>> [email protected] 
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: 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
> [email protected]
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

-- 
Matthias Kuhn
OPENGIS.ch - https://www.opengis.ch
Spatial • (Q)GIS • PostGIS • Open Source



signature.asc
Description: OpenPGP digital signature
___
Qgis-developer mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Managing Python dependencies automatically for the user

2016-01-14 Thread Tim Sutton
Hi

> On 14 Jan 2016, at 18:06, Pablo Fernández Moniz 
>  wrote:
> 
> Hi!
> 
>  We are currently developing a QGIS plugin were we wish to generate some 
> Excel files as output.
> 
>  In order to build the spreadsheet file we need to use some python modules 
> installed from pip (openpyxl, xlwt, etc). This dependency will force every 
> user to manually install the needed package form the pip repository.
> 
>  This situation leaves us with the following question: is possible or it will 
> be in the future to manage this kind of dependencies from QGIS side when the 
> user installs the plugin?

Although it has been discussed and some prototyping was done to support 
automatic installation of dependencies at the last hackfest, there isn’t 
anything in the released versions of QGIS to support this yet. If your packages 
have no operating system specific binaries in them, then I suggest to bundle 
them into your plugin and use an appropriate import path relative to your code. 
Note there is a limit on how big your plugin can be (I think it is 10mb) so you 
need to ensure your 3rd party deps do not bulk out your plugin too much.

Regards

Tim

> 
>  Thank you for your time!
> 
>  Kind regards.
> 
> --
> 
> Pablo Fernández Moniz
> GIT Analyst
> 
> Web Linkedin 
>    Twitter 
> 
> ___
> Qgis-developer mailing list
> [email protected]
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: 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



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
Qgis-developer mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer