Opened 5 years ago

Closed 5 years ago

#3738 closed enhancement (fixed)

Make python version configurable on compilation time

Reported by: pmav99 Owned by: grass-dev@…
Priority: normal Milestone: 7.8.0
Component: Compiling Version: git-releasebranch78
Keywords: python3 Cc:
CPU: Unspecified Platform: All

Description

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

Change History (3)

comment:1 by neteler, 5 years ago

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.

comment:2 by pmav99, 5 years ago

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:

comment:3 by neteler, 5 years ago

Milestone: 7.8.0
Resolution: fixed
Status: newclosed
Version: unspecifiedgit-releasebranch78

Meanwhile we have everywhere in G7.8+:

#!/usr/bin/env python3

Closing as fixed.

Note: See TracTickets for help on using tickets.