-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Migrate all scripts, symlinks, and installed tools to Python3 #6376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
And what about using virtualenv as wrapper? This also allows to create a stand-alone Python 2.7 environment if conversion takes more time than expected. |
I think the point is that Python 2.7 is dead as of January 1, 2020, so virtualenv's not really a solution. Without the python 2 executable, the virtualenv would run under the Python 3 interpreter, in fact. I don't think there's any issue with scripts we're using, they should already run fine under Py3. The standalone Python we're using for Windows is kind of a virtualenv. We install the needed libraries right in the core directories, and it only uses PYCs from inside the installation dir, not system-wide ones (assuming there's some system-wide Python installed on the user's Windows). |
Python 2 EOL is Jan 1, 2020. Migrate scripts to run under Python 3. Under Windows, we're already running Python 3.7, by dumb luck. The oddness is that the Windows standalone executable for Python 3 is called "python" whereas under UNIX-like OSes it's called "python3" with "python" always referring to the Python 2 executable. The ZIP needs to be updated to include a Python3.exe (copy of Python.exe) so that we can use the same command lines under Linux and Windows, and to preserve my sanity. Fixes esp8266#6376
* Move all scripts and documentation to Python3 Python 2 EOL is Jan 1, 2020. Migrate scripts to run under Python 3. Under Windows, we're already running Python 3.7, by dumb luck. The oddness is that the Windows standalone executable for Python 3 is called "python" whereas under UNIX-like OSes it's called "python3" with "python" always referring to the Python 2 executable. The ZIP needs to be updated to include a Python3.exe (copy of Python.exe) so that we can use the same command lines under Linux and Windows, and to preserve my sanity. Fixes #6376 * Add new Windows ZIP with python3.exe file * Sort options in boards.txt generation for repeatability The order of the board opts dict changes depending on the Python version and machine, so sort the options before printing them to get a stable ordering. * Re-add Python2 compatibility tweaks Most scripts can run as Python 2 or Python 3 with minimal changes, so re-add (and fix, as necessary) compatibility tweaks to the scripts.
Python 2 has less than 5 months left to live (or at least, until all support ends)
https://pythonclock.org/
#6364 had an issue with a symlink to Python 2 being installed in the tools directory, which is one part but not all.
We need to:
. Update all script refs from
/usr/bin/python
to/usr/bin/python3
. Update the tools python-wrapper.tgz to point to python3
. Update the Windows standalone installation to python3
. Update platform.txt/etc. to ensure it's using the right python verison
. Validate things still work.
It's not as simple as changing scripts to
#/usr/bin/env python
, either, as that only works if there is a Python2 installation somewhere. Newer OS releases may not install Python2 by default.The text was updated successfully, but these errors were encountered: