<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">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></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><br>On Wed, Sep 5, 2018 at 9:41 PM Martin Landa <<a href="mailto:landa.martin@gmail.com" target="_blank">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" target="_blank">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><div><br></div><div>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.</div><div><br></div><div>- python as a link to python2 is no longer available on modern distros</div><div>- python3 is older than GRASS7</div><div>- all currently supported distros provide a full python3 environment</div></div></blockquote><div><br></div><div>Hi Markus and Martin,<br></div><div><br></div><div>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.</div><div><br></div><div>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></div><div><br></div><div>As for the shebang, PEP394 says: "for the time being, all distributions <em>should</em> ensure that <tt class="gmail-docutils gmail-literal">python</tt>,
if installed, refers to the same target as <tt class="gmail-docutils gmail-literal">python2</tt>, unless the user
deliberately overrides this or a virtual environment is active" and that "<tt class="gmail-docutils gmail-literal">python</tt> 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.</div><div><br></div><div>Best,<br></div><div>Vaclav</div><div></div><div><br></div><div><br></div><div>Links:<br></div><div><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></div><div><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></div><div><a href="https://launchpad.net/ubuntu/+source/wxpython4.0">https://launchpad.net/ubuntu/+source/wxpython4.0</a><br></div><div><a href="https://www.python.org/dev/peps/pep-0394/">https://www.python.org/dev/peps/pep-0394/</a><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>Markus M<br></div><br></div>
_______________________________________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org" target="_blank">grass-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-dev</a></blockquote></div></div></div></div></div></div>