uv icon indicating copy to clipboard operation
uv copied to clipboard

Add setting to manage preference for managed toolchains

Open zanieb opened this issue 1 year ago • 5 comments

Users should be able to opt in and out of managed toolchains, e.g.

managed-toolchains = always | preferred | fallback | never

zanieb avatar Jun 10 '24 14:06 zanieb

We could also frame this differently, like..

toolchain-discovery = prefer-system | prefer-managed | only-system | only-managed

zanieb avatar Jun 10 '24 14:06 zanieb

We could also frame this differently, like..

toolchain-discovery = prefer-system | prefer-managed | only-system | only-managed

What about?

toolchains = uv-first | system-first | managed-first | uv-only | system-only | managed-only

Or you could explicitly configure python providers like PDM. People might (and are) using tools like mise asdf pyenv.

baggiponte avatar Jun 20 '24 09:06 baggiponte

What's the difference between uv-only and managed-only there?

I don't think we'll support discovery of Python interpreters in other tool's installation directories. It seems more reasonable to just expect them to be registered in the PATH (or, on WIndows, in the registry).

zanieb avatar Jun 20 '24 13:06 zanieb

What's the difference between uv-only and managed-only there?

I don't think we'll support discovery of Python interpreters in other tool's installation directories. It seems more reasonable to just expect them to be registered in the PATH (or, on WIndows, in the registry).

Makes sense, but then I guess what's the difference between system python and other tools? In other words, brew python should just not come up, am I correct?

baggiponte avatar Jun 20 '24 15:06 baggiponte

A "system" Python here is any Python toolchain installed on the system i.e. not being managed by uv. Brew Python will come up if it's on the PATH, but we won't try to discover it a Brew-specific location (as we won't, thusfar, attempt to discover pyenv Python in their storage directory)

zanieb avatar Jun 20 '24 15:06 zanieb

It would be useful to be able to tell uv to prefer using asdf/pyenv discovery/installation if that's available rather than only python-build-standalone

delfick avatar Sep 14 '24 07:09 delfick

This issue is actually completed: https://docs.astral.sh/uv/reference/settings/#python-preference

Feel free to open a new one to track support for other managed Python distribution kinds, but we're pretty unlikely to support more.

zanieb avatar Sep 14 '24 13:09 zanieb

sure, done https://github.com/astral-sh/uv/issues/7400

Thanks!

delfick avatar Sep 14 '24 21:09 delfick