There are several ways to set the backend, like environment variable, command line, and with a fall-through list. However, it's hard to tell which backend you actually have inside the noxfile. It looks like (from #795) it might not even be possible to just check which("uv") to see if uv is present reliably. So I think being able to get the venv_backend string back out with the final selection would be useful.
Or, actually, probably making it an abstract property would be better.
Describe alternatives you've considered
The .virtualenv property does give you the backend, but each backend is different and accessing the properties only defined on ProcessEnv subclasses doesn't really feel like public API.
I'm currently using:
if getattr(session.virtualenv, "venv_backend", "") != "uv":
session.install("uv")
Anything else?
It looks like prog @ . doesn't work for pip, so this will need to be based on the backend. :/
How would this feature be useful?
There are several ways to set the backend, like environment variable, command line, and with a fall-through list. However, it's hard to tell which backend you actually have inside the noxfile. It looks like (from #795) it might not even be possible to just check
which("uv")
to see if uv is present reliably. So I think being able to get the venv_backend string back out with the final selection would be useful.Describe the solution you'd like
Or, actually, probably making it an abstract property would be better.
Describe alternatives you've considered
The
.virtualenv
property does give you the backend, but each backend is different and accessing the properties only defined on ProcessEnv subclasses doesn't really feel like public API.I'm currently using:
Anything else?
It looks like
prog @ .
doesn't work for pip, so this will need to be based on the backend. :/