Summary
Our company has a set of managed Python interpreters. We don't want our employees to use other interpreters - including both the python-build-standalone ones and the ones that ship with the distro or OS.
With UV_PYTHON_DOWNLOADS='never' and UV_PYTHON_PREFERENCE='only-system' we can force uv (or a wrapper around uv that we provide, more likely) to never use the python-build-standalone interpreters and to only use interpreters that are already on the machine, but we don't have any reasonable way to prevent it from picking up interpreters in /usr/bin that come with the distro. We can't just remove /usr/bin from $PATH without breaking other things.
There's an environment variable, UV_TEST_PYTHON_PATH, that can be used to do exactly what we want - control the path to be used by uv for discovery of system interpreters without affecting the path used for other things. That exists because the uv test suite has the same need as we do, wanting to ignore some interpreters and only use ones found in a particular set of places.
Can that environment variable be documented as part of uv's official support surface?
Example
No response
Summary
Our company has a set of managed Python interpreters. We don't want our employees to use other interpreters - including both the python-build-standalone ones and the ones that ship with the distro or OS.
With
UV_PYTHON_DOWNLOADS='never'andUV_PYTHON_PREFERENCE='only-system'we can forceuv(or a wrapper arounduvthat we provide, more likely) to never use the python-build-standalone interpreters and to only use interpreters that are already on the machine, but we don't have any reasonable way to prevent it from picking up interpreters in/usr/binthat come with the distro. We can't just remove/usr/binfrom$PATHwithout breaking other things.There's an environment variable,
UV_TEST_PYTHON_PATH, that can be used to do exactly what we want - control the path to be used byuvfor discovery of system interpreters without affecting the path used for other things. That exists because theuvtest suite has the same need as we do, wanting to ignore some interpreters and only use ones found in a particular set of places.Can that environment variable be documented as part of
uv's official support surface?Example
No response