use major/minor version of Python command being used if req_py_majver/req_py_minver are not specified #1907
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Important note: the part of the code being changed here is only relevant if
Python
is not included as a dependency, so it only affects a very limited amount of easyconfigs for Python software (mostlyEasyBuild
itself, but alsoPyYAML
easyconfigs using thesystem
toolchain,ReFrame
, etc.).The changes here fix the issue reported in easybuilders/easybuild-easyconfigs#9151, where installing an
EasyBuild
easyconfig (for example viaeb --install-latest-eb-release
) fails in the sanity check, because the installation is performed using the systempython
command, while the sanity check paths are derived using the Python version that is used to run EasyBuild with (basically becauseSYS_PYTHON_VERSION
is used inallow_system_deps
in theEasyBuild
easyconfigs).By specifying that the major/minor Python version of the Python being used by EasyBuild itself (via
sys.version_info
) as requirement when picking thepython
command, the correctpython
command is picked, and things work out correctly...We're changing the default value for
req_py_majver
andreq_py_minver
here, but that's OK to do imho since i) this doesn't affect easyconfigs which already set a different major/minor version (seeReFrame
easyconfigs for example), and ii) the current default of requiring Python 2.6 was sort of dodgy anyway (it worked well while EasyBuild only supported Python 2, but not anymore).This not only fixes the issue for
EasyBuild
reported in easybuilders/easybuild-easyconfigs#9151, but also forPyYAML-3.13.eb
for example (when the systempython
is Python 2.7, but EasyBuild itself is being run with Python 3.x).