-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
gen_esp32part.py and deprecation of Python 2 (IDFGH-4606) #6421
Comments
Thanks for reporting. |
Hi @Martin-Laclaustra. Thank you for the suggestion.
Which Linux distributions are you talking about? I think all of them provide some possibility to have a "python" defined. I personally really don't like hardcoding "python3" into all of the scripts. (ESP-IDF have aprox. 160 scripts!). The right way is to setup the desired Python at the distribution level. We have recommendations regarding that in the documentation, for example for Ubuntu: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-setup.html#setting-up-python-3-as-default-for-ubuntu-and-debian Please take a look at them to see if any of them are suitable for you. Another argument against is that the upcoming release (v4.3) still supports Python 2. Forcing Python 3 in the scripts would mean a breaking change for developers who stuck with Python 2. The default Python is used only when you run |
I also commented in the linked espressif/arduino-esp32#4717. I'm closing this now because currently a couple of workarounds are documented and we are tracking related future improvements elsewhere. |
All due respect, but this is not a liking / not-liking problem, but the standard way *nix systems are set up. The correct way is actually to add For a further discussion on why hacking /usr/bin/env is bad, see https://askubuntu.com/questions/817255/default-to-python3-for-usr-bin-env-python Broadly, a lot of esp-idf users are engineers or hobby-engineers, therefore requiring them to modify their correctly set up systems is not the best approach and may break many other applications they rely on. |
Thank you @adam-ah for your interest in this topic. I don't think that the current situation is ideal. We will work on improving it. I'm aware of the content of the links. We will find a better solution which works for all of our customers. I'll respond to your PR in a short time. |
Install and export script should work on systems without "python" executable. Closes #6471 Closes #6532 Related to #6421 and espressif/arduino-esp32#4717
Install and export script should work on systems without "python" executable. Closes #6471 Closes #6532 Related to #6421 and espressif/arduino-esp32#4717
Install and export script should work on systems without "python" executable. Closes #6471 Closes #6532 Related to #6421 and espressif/arduino-esp32#4717
Install and export script should work on systems without "python" executable. Closes #6471 Closes #6532 Related to #6421 and espressif/arduino-esp32#4717
Install and export script should work on systems without "python" executable. Closes #6471 Closes #6532 Related to #6421 and espressif/arduino-esp32#4717
Due to deprecation of Python 2 some Linux distributions have decided to remove the generic "python" executable from the path, forcing all code to explicitly declare which version of Python they require (A wise solution in my opinion, as it serves as "canary" for undefined code and prevents obscure errors, resolving the longstanding ambiguity, and still allows the use of older python 2 code). This change has been annoying when one's mind is in other tasks, but one must adapt to new times and deprecation was announced years ago.
I was proposing to change the shebang to
#!/usr/bin/env python3
here espressif/arduino-esp32#4717 but me-no-dev suggested that a global upstream action might be suitable.Best regards.
The text was updated successfully, but these errors were encountered: