[GRASS-dev] Documentation server build log full of syntax errors in pygrass

Hi Pietro,

the build log on a server which is creating the documentation is full of syntax errors in coming from pygrass. It’s actually just one error but in broadly used part (t.* as well as gunittest are affected). I guess that the other error is just the result of the first one (see end of email for tracebacks).

It seems that syntax:

grc = [“A: C”, “B: D”, “C: E”]
env = {k.strip(): v.strip() for k, v in [row.split(‘:’) for row in grc if row]}
env
{‘A’: ‘C’, ‘C’: ‘E’, ‘B’: ‘D’}

is not supported.

It seems to me that dictionary comprehension is not supported in Python 2.6 but I was not able to confirm this in the Python documentation.

I’m also not sure if the server still uses Python 2.6. Markus are you able to check this?

Thanks for looking into that,

Vaclav

[1] http://grass.osgeo.org/grass71/binary/linux/snapshot/build.log

Traceback (most recent call last):
File “…/scripts/t.vect.observe.strds”, line 51, in
import grass.temporal as tgis
File “…/etc/python/grass/temporal/init.py”, line 28, in
from temporal_algebra import *
File “…/etc/python/grass/temporal/temporal_algebra.py”, line 450, in
import grass.pygrass.modules as pymod
File “…/etc/python/grass/pygrass/modules/init.py”, line 2, in
from grass.pygrass.modules.interface import Module, ParallelModuleQueue
File “…/etc/python/grass/pygrass/modules/interface/init.py”, line 9, in
from grass.pygrass.modules.interface import module
File “…/etc/python/grass/pygrass/modules/interface/module.py”, line 16, in
from .env import G_debug
File “…/etc/python/grass/pygrass/modules/interface/env.py”, line 18
env = {k.strip(): v.strip() for k, v in [row.split(‘:’)
^
SyntaxError: invalid syntax

Traceback (most recent call last):
File “/usr/local/lib/python2.6/dist-packages/Sphinx-1.3.1-py2.6.egg/sphinx/ext/autodoc.py”, line 385, in import_object
import(self.modname)
File “…/etc/python/grass/temporal/init.py”, line 28, in
from temporal_algebra import *
File “…/etc/python/grass/temporal/temporal_algebra.py”, line 450, in
import grass.pygrass.modules as pymod
File “…/etc/python/grass/pygrass/modules/init.py”, line 2, in
from grass.pygrass.modules.interface import Module, ParallelModuleQueue
File “…/etc/python/grass/pygrass/modules/interface/init.py”, line 7, in
from grass.pygrass.modules.interface import flag
ImportError: cannot import name flag

Hi Vaclav,

Il 11/giu/2015 04:33 AM, “Vaclav Petras” <wenzeslaus@gmail.com> ha scritto:

It seems to me that dictionary comprehension is not supported in Python 2.6 but I was not able to confirm this in the Python documentation.

Yes, python2.6 does not support the list comprehension syntax, I will fix this today…

Can we drop the support for python 2.6?

Best regards

Pietro

On Thu, Jun 11, 2015 at 6:32 AM, Pietro <peter.zamb@gmail.com> wrote:

Il 11/giu/2015 04:33 AM, "Vaclav Petras" <wenzeslaus@gmail.com> ha scritto:

It seems to me that dictionary comprehension is not supported in Python
2.6 but I was not able to confirm this in the Python documentation.

Yes, python2.6 does not support the list comprehension syntax, I will fix
this today...

Can we drop the support for python 2.6?

The OSGeo server is running an old Debian version. Unless they get
finally the new machine up, it will be impossible to upgrade Debian.
However, I'll discuss it with the OSGeo SAC guys again.

ciao
Markus

On Thu, Jun 11, 2015 at 6:32 AM, Pietro <peter.zamb@gmail.com> wrote:

Hi Vaclav,

Il 11/giu/2015 04:33 AM, "Vaclav Petras" <wenzeslaus@gmail.com> ha scritto:

It seems to me that dictionary comprehension is not supported in Python
2.6 but I was not able to confirm this in the Python documentation.

Yes, python2.6 does not support the list comprehension syntax, I will fix
this today...

Hopefully fixed in r65438.

On Thu, Jun 11, 2015 at 12:15 PM, Pietro <peter.zamb@gmail.com> wrote:

On Thu, Jun 11, 2015 at 6:32 AM, Pietro <peter.zamb@gmail.com> wrote:
> Hi Vaclav,
>
> Il 11/giu/2015 04:33 AM, "Vaclav Petras" <wenzeslaus@gmail.com> ha scritto:
>> It seems to me that dictionary comprehension is not supported in Python
>> 2.6 but I was not able to confirm this in the Python documentation.
>
> Yes, python2.6 does not support the list comprehension syntax, I will fix
> this today...

Hopefully fixed in r65438.

I have manually triggered the compilation on the grass.osgeo.org server:

Looks good:
http://grass.osgeo.org/grass71/binary/linux/snapshot/error.log
--> no errors any more

http://grass.osgeo.org/grass71/manuals/temporal.html
--> all created again

Full log:
http://grass.osgeo.org/grass71/binary/linux/snapshot/build.log

Unless there are other implications, a backport of r65438 would be good.

Markus

On Thu, Jun 11, 2015 at 1:34 PM, Markus Neteler <neteler@osgeo.org> wrote:

Unless there are other implications, a backport of r65438 would be good.

Right, the change should be save therefore backported in r65439.

Have a nice day.

Pietro

On Thu, Jun 11, 2015 at 2:14 PM, Pietro <peter.zamb@gmail.com> wrote:

On Thu, Jun 11, 2015 at 1:34 PM, Markus Neteler <neteler@osgeo.org> wrote:

Unless there are other implications, a backport of r65438 would be good.

Right, the change should be save therefore backported in r65439.

Excellent, docs are back:
http://grass.osgeo.org/grass70/manuals/temporal.html

Markus