-
Notifications
You must be signed in to change notification settings - Fork 682
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
Play scripts upgrade to Python 3 #1355
Conversation
Update (25 oct 2021) |
The python exec has not been updated (/python), Do we really need to keep it ? I thinking about removing it ? |
I personally haven't used |
I was thinking the same thing. I don't think we can lose the Python command wrapper for the moment and ideally it can be upgraded to support Python 3. I think I'm in the same boat as @tomparle with using Heroku which now only supports Python 3 with its latest stack. |
the wrapper is only for windows user, as it is the python.exe. So for windows user they will need to have it on their computer same for linux. or am I missing something ? |
@xael-fry Ah Windows... Then we can drop it. Who cares about Windows users. :) |
Ah ok, I was confused about what you were referring to. As long as I can still call Play commands on MacOS and Linux then I'm good 😄 |
Sorry for the late answer and thank you for the merge ! |
Removing the /python folder will make play! useless out of the box in a Windows environment if the python is not installed. In my opinion, it is very bad for newbies if the getting started tips will fail because of lack of python. |
@tomparle can you rebase this pr to master ? |
@xael-fry I spent quite some time to rebase properly (and fix my previous rebase mistakes), upgrade some recent changes to python 3 syntax, and fix some python libs which I did not setup properly due to some confusion with python system libs. Finally the merge and the tests seems ok, except for the windows environment test suite which does not terminate. I do not use Windows for developing and does not know what's causing these tests to be suspend so some help could be useful. |
Has anyone tried this on Windows? I get "ModuleNotFoundError: No module named 'win32pdh'" when using python 3.9.1 on Windows. |
$ pip install pypiwin32 works fine Play 1.7 with Windows |
Thank you 👍 |
Upgrade all Play commands to python 3 (they were originally written in python 2).
Purpose
This allow to keep Play 1 up-to-date with the current status of Python, whose version 2 is now longer maintained since January 1st, 2020.
This also allows to use Play in modern environments without Python 2 support, like Heroku current stack.
Fixes
fixes #1353
Notes
I helped the migration with
futurize
but there was still quite some work to do manually.I tested most commands and a successful build to Heroku-20 stack as well (which only supports python 3).
Migration notes
This is a breaking change. This PR removes Python 2 support and requires now Python 3.
You may want to remove some print "hello" lines in some modules of your project that uses Play. The syntax causes an error in Python 3, and those lines are just sample code from the module template. They can be removed safely.
If you have custom-made modules with python scripts, you should migrate them manually to Python 3 (see some hints here : https://docs.python.org/3/howto/pyporting.html)