<div dir="ltr"><br><br>On Thu, Sep 6, 2018 at 5:28 AM Vaclav Petras <<a href="mailto:wenzeslaus@gmail.com">wenzeslaus@gmail.com</a>> wrote:<br>><br>><br>><br>> On Wed, Sep 5, 2018 at 3:57 PM Markus Metz <<a href="mailto:markus.metz.giswork@gmail.com">markus.metz.giswork@gmail.com</a>> wrote:<br>>><br>>><br>>><br>>> On Wed, Sep 5, 2018 at 9:41 PM Martin Landa <<a href="mailto:landa.martin@gmail.com">landa.martin@gmail.com</a>> wrote:<br>>> ><br>>> > Hi,<br>>> ><br>>> > st 5. 9. 2018 v 21:38 odesílatel Markus Metz<br>>> > <<a href="mailto:markus.metz.giswork@gmail.com">markus.metz.giswork@gmail.com</a>> napsal:<br>>> > > alternatively, the shebang in GRASS *.py files can be changed to python3 (should be changed to python3 according to Python developer's Guide PEP394)<br>>> ><br>>> > we are going to support both Python2 and 3, at least for 7.6/7.8, right? Ma<br>>><br>>> the symbolic link python is deprecated and will disappear soon from current distros: GRASS does not work if python does not exist, while python2 and/or python3 might exist. Current distros are already replacing the shebang in GRASS *.py files with python2. IMHO, if we want to support python3 we need to change the shebang accordingly: no more support for python2 in trunk.<br>>><br>>> - python as a link to python2 is no longer available on modern distros<br>>> - python3 is older than GRASS7<br>>> - all currently supported distros provide a full python3 environment<br>><br>><br>> Hi Markus and Martin,<br>><br>> That being said, GRASS GIS does not fully support Python 3 yet and, with exception of few contributions, there was no major work done on the Python 3 support up until recently, i.e. we are not ready to switch to 3 for 7.6. I think we can have something like "technical preview" in 7.8 (e.g. with warning "use 3 only if you have to"). 8.0 should fully support 3.<br>><br>> Another thing is that Python 3 means using wxPython 4 to get the GUI (other wxPythons don't support Python 3). That was hard to do for quite some time (4.0.0 released in January), but now it is included, e.g., in Ubuntu 18.04 (released April).<br>><br>> As for the shebang, PEP394 says: "for the time being, all distributions should ensure that python, if installed, refers to the same target as python2, unless the user deliberately overrides this or a virtual environment is active" and that "python should be used in the shebang line only for scripts that are source compatible with both Python 2 and 3" which is what we aim for. So that tells me we should keep there `python` and if a distro decides to patch it to 2 (because their `python` does not point to `python2` as PEP394 suggests) or perhaps later to 3 (because they want to ensure `python3`), they are free to do that. We are not planning to drop support for 2, so keeping `python` in shebang is appropriate in the long term according to PEP394.<br><div><br></div><div>That means that trunk will continue to use python2 by default, and it also requires that the link python is installed, which will, if installed, refer to the same target as python2.</div><div><br></div><div>If we want to get python3 support tested in trunk, we must make it clear to testers that python must refer to python3, contrary to PEP394, i.e. "the user deliberately overrides this".</div><div><br></div><div>IMHO, we would get more feedback on python3 support if we change the shebang to python3 in trunk.</div><div><br></div>Markus M<br><div><br></div><div>></div>> Best,<br>> Vaclav<br>><br>><br>> Links:<br>> <a href="https://wxpython.org/news/wxpython-4.0.0-release/index.html">https://wxpython.org/news/wxpython-4.0.0-release/index.html</a><br>> <a href="https://wxpython.org/news/wxpython-4.0.0a1-release/index.html">https://wxpython.org/news/wxpython-4.0.0a1-release/index.html</a><br>> <a href="https://launchpad.net/ubuntu/+source/wxpython4.0">https://launchpad.net/ubuntu/+source/wxpython4.0</a><br>> <a href="https://www.python.org/dev/peps/pep-0394/">https://www.python.org/dev/peps/pep-0394/</a><br>>  <br>>><br>>><br>>> Markus M<br>>><br>>> _______________________________________________<br>>> grass-dev mailing list<br>>> <a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>>> <a href="https://lists.osgeo.org/mailman/listinfo/grass-dev">https://lists.osgeo.org/mailman/listinfo/grass-dev</a></div>