[GRASS-dev] [GRASS GIS] #3738: Make python version configurable on compilation time

#3738: Make python version configurable on compilation time
-------------------------+-------------------------
Reporter: pmav99 | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Compiling | Version: unspecified
Keywords: python3 | CPU: Unspecified
Platform: All |
-------------------------+-------------------------
Not sure how easy it would be to implement, but I think it would be a good
idea to have a configuration option that would let us choose the python
binary for the compilation and the GRASS session. E.g.

{{{
     --with-python=/usr/bin/python2
# vs
     --with-python=/usr/bin/python3
# or even a virtualenv
     --with-python=/home/username/.venvs/grass/bin/python
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3738&gt;
GRASS GIS <https://grass.osgeo.org>

#3738: Make python version configurable on compilation time
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone:
Component: Compiling | Version: unspecified
Resolution: | Keywords: python3
       CPU: Unspecified | Platform: All
--------------------------+-------------------------

Comment (by neteler):

Probably it would make sense, at least for this hardcoded version (this
fact is unfortunate since it doesn't even respect GRASS_PYTHON):

{{{
grep python include/Make/Platform.make.in
PYTHON = python
}}}

Though it would still not solve the problem of all shebangs
(`#!/usr/bin/env python`) yet if only `python3` exists on the system as a
binary.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3738#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3738: Make python version configurable on compilation time
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone:
Component: Compiling | Version: unspecified
Resolution: | Keywords: python3
       CPU: Unspecified | Platform: All
--------------------------+-------------------------

Comment (by pmav99):

The shebangs issue is probably solvable with a `find -exec sed` at the end
of the compilation. Nevertheless, according to Guido van Rossum everything
would be much much simpler if there was only "python2" and "python3". If
anyone is interested:

- https://github.com/python/peps/pull/630
- https://github.com/python/peps/blob/master/pep-0394.txt

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3738#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3738: Make python version configurable on compilation time
--------------------------+---------------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 7.8.0
Component: Compiling | Version: git-releasebranch78
Resolution: fixed | Keywords: python3
       CPU: Unspecified | Platform: All
--------------------------+---------------------------------
Changes (by neteler):

* status: new => closed
* version: unspecified => git-releasebranch78
* resolution: => fixed
* milestone: => 7.8.0

Comment:

Meanwhile we have everywhere in G7.8+:

`#!/usr/bin/env python3`

Closing as fixed.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3738#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>