-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Describe the bug
We use a custom index that currently lists only Python 3.13, 3.13t, 3.12, and 3.11. We omit 3.14 because it is a prerelease version. When a user first runs Python, it attempts and fails to install 3.14, even though it isn't in the index:
> python -c "import sys; print(sys.executable);"
Welcome to the Python installation manager configuration helper.
********************************************************************************
You do not have any Python runtimes installed.
Install the current latest version of CPython? If not, you can use 'py install
default' later to install, or one will be installed automatically when needed.
********************************************************************************
[ERROR] Failed to find a suitable install for '3.14'.
To Reproduce
Steps to reproduce the behavior:
- Download this index.json file.
- Set
PYTHON_MANAGER_SOURCE_URL
env var to point to that file. - Set
PYTHON_MANAGER_CONFIRM
env var tofalse
. - Run
python -c "import sys; print(sys.executable);"
and note the error.
Expected behavior
I would expect it to install 3.13, the latest version in the index.
Additional context
I'm trying to get unattended installs working on Jenkins build agent servers. Our build agents runs as a specific user, so Python has to auto-install with no problems when a non-interactive build on a server first runs python
.
Yes, I could use the PYTHON_MANAGER_DEFAULT
environment variable, but I don't want to. That's one more thing for me to manage, and it's a version number, which means I have to continue to manage it as new versions of Python are installed.
Docs also explicitly state that it won't attempt to install a prerelease version by default:
The preferred default version to launch or install. By default, this is interpreted as the most recent non-prerelease version from the CPython team.