Skip to content
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

Add detection of python3 binary. #248

Merged
merged 1 commit into from
Jan 7, 2022

Conversation

nirvdrum
Copy link
Contributor

@nirvdrum nirvdrum commented Jan 5, 2022

Python 2 is being or has been phased out of default installations on many systems. PEP 394 means systems such as Ubuntu will not alias python3 to python by default. In order to use the Python 3 binary with mx, the end user must either set MX_PYTHON=python3, MX_PYTHON_VERSION=3, or set up an alias by some other means. It would be helpful if mx checked if python3 exists and use it, as part of its existing executable search.

This should maintain full backwards-compatibility. The python3 binary is only chosen if python2.7, python2, and python do not exist.

@zakkak
Copy link
Contributor

zakkak commented Jan 5, 2022

I think python3 should be preferred when available even if that breaks "full backwards-compatibility" as python2 has reached its end of life.

@nirvdrum
Copy link
Contributor Author

nirvdrum commented Jan 5, 2022

@dougxc @gilles-duboscq Can we favor Python 3 over 2? If so, I'll reorder the executable checks in this PR.

Additionally, that Python 3.x gate failure looks unrelated to my changes.

@fniephaus
Copy link
Member

Can we favor Python 3 over 2?

IIRC we looked into exactly this only recently and ran into a bunch of problems that need to be addressed first (or simultaneously). Anyway, I agree that it needs to happen sooner rather than later.

@fniephaus fniephaus requested a review from dougxc January 6, 2022 13:06
@fniephaus
Copy link
Member

Assigning to @dougxc who is currently working on this. We may be dropping Python 2 support entirely soon.

@nirvdrum
Copy link
Contributor Author

nirvdrum commented Jan 6, 2022

Thanks. Regardless of dropping Python 2 support, this PR would help environments where only Python 3 is installed.

@dougxc
Copy link
Member

dougxc commented Jan 6, 2022

I agree that merging this in the interim is a good idea. Would you be able to take care of that @fniephaus while I focus on the larger change to drop python2 altogether?

BTW, I've opened #249 to track the larger change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants