diff --git a/roles/ensure-python/README.rst b/roles/ensure-python/README.rst index 9b568d520..e06110e71 100644 --- a/roles/ensure-python/README.rst +++ b/roles/ensure-python/README.rst @@ -25,8 +25,10 @@ There are three ways to install the python interpreter: :type: str Optional version of python interpreter to install, such as ``3.7``. - Note that you should use a string value for this variable rather than - a float. This avoids problems with 3.10 being evaluated as 3.1. + Note that you should use a string value for this variable rather than a + float. This avoids problems with 3.10 being evaluated as 3.1. With the + pyenv backend it's not currently possible to select special-purpose + builds like the free-threading (no-GIL) variants. .. zuul:rolevar:: python_use_pyenv :type: bool diff --git a/roles/ensure-python/tasks/pyenv.yaml b/roles/ensure-python/tasks/pyenv.yaml index 3e8008533..ab131ab80 100644 --- a/roles/ensure-python/tasks/pyenv.yaml +++ b/roles/ensure-python/tasks/pyenv.yaml @@ -28,10 +28,13 @@ # NOTE(mnaser): python-build does not allow us to let it install Python from a specific # series so we have to do some magic to find out what's the latest # release from a series +# NOTE(fungi): due to https://github.com/pyenv/pyenv/issues/3015 we need to +# filter out no-GIL/free-threading "t" suffixed versions, since +# they don't provide the expected vanilla executables - name: Determine Python version shell: | set -o pipefail - {{ ansible_user_dir }}/.pyenv/plugins/python-build/bin/python-build --definitions | grep ^{{ python_version }} | tail -1 + {{ ansible_user_dir }}/.pyenv/plugins/python-build/bin/python-build --definitions | grep ^{{ python_version }} | grep -v t$ | tail -1 args: executable: /bin/bash register: _python_version