[GRASS-dev] grass-session integration into core
Vaclav Petras
wenzeslaus at gmail.com
Thu Jun 10 18:48:40 PDT 2021
On Wed, Jun 9, 2021 at 3:27 AM Stefan Blumentrath <
Stefan.Blumentrath at nina.no> wrote:
>
>
> ...I am not sure if it is feasible to throw an informative error message
> if users try to use GRASS functions without a running session…
>
If you run without the runtime environment (modules are not on path), we
could catch FileNotFoundError in grass.script.start_command() and re-raise
or raise a different exception based on the presence of environmental
variables (such as GISBASE) to help user debug it, although a
troubleshooting or FAQ section may have the similar effect.
If you somehow manage to run with the runtime, but without the
db/location/mapset thingy being open/current, you currently get some
complaint from modules about a LOCATION variable not being defined which is
cryptic, but can be improved.
> That said, what would the gain of a pip package be? If you install GRASS
> you would have the functionality. If you did not install GRASS you could
> not use a pip package with grass-session like functionality anyway, no?
>
I don't see advantages in a pip package like this either. It would be a
similar scenario as now except that the version sync is better and that it
shows the weirdness of grass-session better: Let's say you build GRASS in a
Docker image. Then, you run pip on part of the source code in order to make
the thing you just built actually work!? Why isn't the grass-session
package installation part of the build if it is needed anyway to make
GRASS work?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20210610/556a8f80/attachment.html>
More information about the grass-dev
mailing list