[GRASS-dev] v.in.pygbif addon: Manual does not build

Hei,

Does anyone have an idea why the v.in.pygbif addon-manual does not build? I managed to install it through g.extension and it works fine.

The pygbif library is a dependency of v.in.pygbif. Therefore, I tried to align dependency handling (import) with the working solution in v.class.mlpy as another module with external dependencies. That obviously did not help, unfortunately.

Are error logs from the automatic builds available online somewhere I could check?

I have some uncommitted modifications for the module I like to commit. It would be great to fix the built of the manual in one go.

Thanks for helping in advance.

Cheers

Stefan

SBL wrote

Hei,

Does anyone have an idea why the v.in.pygbif addon-manual does not build?
I managed to install it through g.extension and it works fine.
The pygbif library is a dependency of v.in.pygbif. Therefore, I tried to
align dependency handling (import) with the working solution in
v.class.mlpy as another module with external dependencies. That obviously
did not help, unfortunately.
Are error logs from the automatic builds available online somewhere I
could check?

I have some uncommitted modifications for the module I like to commit. It
would be great to fix the built of the manual in one go.

Thanks for helping in advance.

the logs from tha addon builds for winGRASS can be found here:

https://wingrass.fsv.cvut.cz/grass73/x86_64/addons/grass-7.3.svn/logs/

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/v-in-pygbif-addon-Manual-does-not-build-tp5285571p5285572.html
Sent from the Grass - Dev mailing list archive at Nabble.com.

SBL wrote

Hei,

Does anyone have an idea why the v.in.pygbif addon-manual does not build?
I managed to install it through g.extension and it works fine.
The pygbif library is a dependency of v.in.pygbif. Therefore, I tried to
align dependency handling (import) with the working solution in
v.class.mlpy as another module with external dependencies. That obviously
did not help, unfortunately.
Are error logs from the automatic builds available online somewhere I
could check?

I have some uncommitted modifications for the module I like to commit. It
would be great to fix the built of the manual in one go.

Thanks for helping in advance.

the error is:

ERROR: Cannot import pygbif (https://github.com/sckott/pygbif) library.
       Please install it (pip install pygbif) or ensure that it is on path
       (use PYTHONPATH variable).

in an addon (1) I've used this way for testing if a python package is
available; the manual is building:

151 try:
152 import pyspatialite.dbapi2 as db
153 except:
154 grass.fatal( "pyspatialite is needed to run this
script.\n"
155 "source: https://pypi.python.org/pypi/pyspatialite
\n"
156 "Please activate/install it in your python stack.")

try/except is done in def main():

[1]
https://trac.osgeo.org/grass/browser/grass-addons/grass7/vector/v.in.natura2000/v.in.natura2000.py#L151

HTH

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/v-in-pygbif-addon-Manual-does-not-build-tp5285571p5285574.html
Sent from the Grass - Dev mailing list archive at Nabble.com.

Thanks for your swift reply!

In v.in.pygbif the import of pygbif is also done in a try-except statement.

Maybe the difference is that pyspatialite is installed on the build system,

while pygbif is (naturally) not >(yet)?

https://trac.osgeo.org/grass/browser/grass-addons/grass7/vector/v.in.pygbif/v.in.pygbif.py#L179

179 try:
180 from pygbif import occurrences
181 from pygbif import species
182 except ImportError:
183 grass.fatal(_("Cannot import pygbif
(https://github.com/sckott/pygbif)"
184 " library."
185 " Please install it (pip install pygbif)"
186 " or ensure that it is on path"
187 " (use PYTHONPATH variable)."))
188
189
190 def main():

the difference ist that in v.in.natura2000 it's done in def main(); in
v.in.pygbif it's done before def main()

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/v-in-pygbif-addon-Manual-does-not-build-tp5285571p5285580.html
Sent from the Grass - Dev mailing list archive at Nabble.com.

On Tue, Sep 13, 2016 at 4:52 PM, Helmut Kudrnovsky <hellik@web.de> wrote:

Thanks for your swift reply!

In v.in.pygbif the import of pygbif is also done in a try-except statement.

Maybe the difference is that pyspatialite is installed on the build system,

while pygbif is (naturally) not >(yet)?

Exactly...

root@osgeo6:/home/neteler# pip install pygbif
bash: pip: command not found

How to get pip into this Debian box? (keeping the other 10 virtual
sites on the system intact)
Will be easy but I am more RPM oriented...

thanks
Markus

On Tue, Sep 13, 2016 at 10:52 AM, Helmut Kudrnovsky <hellik@web.de> wrote:

the difference ist that in v.in.natura2000 it's done in def main(); in
v.in.pygbif it's done before def main()

Right, this must be done only after calling grass.script.parser() function
but also in the right scope, so main is usually the right place for short
modules. There are other solutions with using another variable suitable for
more complicated modules (used e.g. in wxGUI), see m.printws:

https://trac.osgeo.org/grass/browser/grass-addons/grass7/misc/m.printws/m.printws.py?rev=69427#L177

On Tue, Sep 13, 2016 at 11:15 AM, Markus Neteler <neteler@osgeo.org> wrote:

root@osgeo6:/home/neteler# pip install pygbif
bash: pip: command not found

I don't think it's necessary to install all addon dependencies on the build
server for Python where it is easy to work around it. Moreover the code is
useful also when user installs the module not having the dependencies (then
it installs, shows the GUI but gives a proper error message as opposed to
failing somewhere in between).

Markus Neteler wrote

On Tue, Sep 13, 2016 at 4:52 PM, Helmut Kudrnovsky &lt;

hellik@

&gt; wrote:

Thanks for your swift reply!

In v.in.pygbif the import of pygbif is also done in a try-except

statement.

Maybe the difference is that pyspatialite is installed on the build

system,

while pygbif is (naturally) not >(yet)?

Exactly...

root@osgeo6:/home/neteler# pip install pygbif
bash: pip: command not found

How to get pip into this Debian box? (keeping the other 10 virtual
sites on the system intact)
Will be easy but I am more RPM oriented...

apt-get install python-pip?

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/v-in-pygbif-addon-Manual-does-not-build-tp5285571p5285594.html
Sent from the Grass - Dev mailing list archive at Nabble.com.

Thanks Helmut, Vaclav, Markus for your support.

Should be fixed now (by moving the import to "dev main()").
I would have liked to do it earlier but we had a failure on the server where I had the code...

Kind regards,
Stefan

-----Original Message-----
From: grass-dev [mailto:grass-dev-bounces@lists.osgeo.org] On Behalf Of Helmut Kudrnovsky
Sent: 13. september 2016 17:21
To: grass-dev@lists.osgeo.org
Subject: Re: [GRASS-dev] v.in.pygbif addon: Manual does not build

Markus Neteler wrote

On Tue, Sep 13, 2016 at 4:52 PM, Helmut Kudrnovsky &lt;

hellik@

&gt; wrote:

Thanks for your swift reply!

In v.in.pygbif the import of pygbif is also done in a try-except

statement.

Maybe the difference is that pyspatialite is installed on the build

system,

while pygbif is (naturally) not >(yet)?

Exactly...

root@osgeo6:/home/neteler# pip install pygbif
bash: pip: command not found

How to get pip into this Debian box? (keeping the other 10 virtual
sites on the system intact) Will be easy but I am more RPM oriented...

apt-get install python-pip?

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/v-in-pygbif-addon-Manual-does-not-build-tp5285571p5285594.html
Sent from the Grass - Dev mailing list archive at Nabble.com.
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Hi again,

There seem to have been other issues, which I tried to address with the help of an HTML validator.
Since that was quite helpful, I took the liberty to add the link to: https://validator.w3.org/
to https://trac.osgeo.org/grass/wiki/Submitting/Docs

Hope that is OK.

Cheers
Stefan

-----Original Message-----
From: grass-dev [mailto:grass-dev-bounces@lists.osgeo.org] On Behalf Of Blumentrath, Stefan
Sent: 18. september 2016 23:29
To: Helmut Kudrnovsky <hellik@web.de>; grass-dev@lists.osgeo.org
Subject: Re: [GRASS-dev] v.in.pygbif addon: Manual does not build

Thanks Helmut, Vaclav, Markus for your support.

Should be fixed now (by moving the import to "dev main()").
I would have liked to do it earlier but we had a failure on the server where I had the code...

Kind regards,
Stefan

-----Original Message-----
From: grass-dev [mailto:grass-dev-bounces@lists.osgeo.org] On Behalf Of Helmut Kudrnovsky
Sent: 13. september 2016 17:21
To: grass-dev@lists.osgeo.org
Subject: Re: [GRASS-dev] v.in.pygbif addon: Manual does not build

Markus Neteler wrote

On Tue, Sep 13, 2016 at 4:52 PM, Helmut Kudrnovsky &lt;

hellik@

&gt; wrote:

Thanks for your swift reply!

In v.in.pygbif the import of pygbif is also done in a try-except

statement.

Maybe the difference is that pyspatialite is installed on the build

system,

while pygbif is (naturally) not >(yet)?

Exactly...

root@osgeo6:/home/neteler# pip install pygbif
bash: pip: command not found

How to get pip into this Debian box? (keeping the other 10 virtual
sites on the system intact) Will be easy but I am more RPM oriented...

apt-get install python-pip?

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/v-in-pygbif-addon-Manual-does-not-build-tp5285571p5285594.html
Sent from the Grass - Dev mailing list archive at Nabble.com.
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev