-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
g.extension: change to python3 #83
Conversation
scripts/g.extension/g.extension.py
Outdated
@@ -675,8 +679,43 @@ def install_extension(source, url, xmlurl): | |||
if sys.platform == "win32": | |||
ret += install_extension_win(module) | |||
else: | |||
# set /usr/bin/python to python3 cause of python shebangs | |||
ps = gscript.Popen(( | |||
"update-alternatives", "--install", "/usr/bin/python", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this part or would the change python -> python3 be enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. Please also note that update-alternatives
will not work on Windows or possibly on some Linux distos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the update-alternatives and replaces the shebangs for not Windows systems
scripts/g.extension/g.extension.py
Outdated
|
||
# change python to python3 in shebang | ||
proc = subprocess.Popen( | ||
"which " + module, shell=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which
cannot be used since it's not multiplatform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the which is removed
Please can you explain in detail this PR. |
I've added code for windows, but unfortunately I can't test it. |
... merging PR for easier testing on Windows |
Backported to relbranch78 in 494bbaf |
* g.extension: change to python3 * g.extension: update for metamodules * g.extension: python3 shebangs for windows
Motivation: the Addons source code is to be used by multiple GRASS versions. Since 7.8+ Python 3 is expected while older versions need Python 2. Hence a global change in all Addons of shebang to Python 3 would be a problem.
Proposed solution: change shebang during installation.