Closed edgarrmondragon closed 6 months ago
pipx doesn't include apps of dependent packages by default. Workaround:
pipx install --include-deps nox[uv]
Some options:
--include-deps
python -m uv
sys.executable
if shutil.which
returns empty handedOption 1 puts the burden on the user, and it puts a bunch of unrelated apps on PATH
(activate-global-python-argcomplete, python-argcomplete-check-easy-install-script, register-python-argcomplete, virtualenv), producing a warning if any of them already exist.
Option 2 is what we do for virtualenv but incurs unnecessary overhead on startup.
Option 3 is a bit messy but would work out of the box. (Only Windows installations don't have the interpreter next to entry-point scripts, but those would be covered by shutil.which
.)
(I guess there's also option 4: Drop the extra in a quick follow-up release? I don't know if there's a five-second rule for backward compatibility.)
Proposal: option 3
pipx install --include-deps nox[uv]
is probably worse than installing nox and uv separately with pipx install nox uv
since it'll put a bunch of other, unrelated stuff on $PATH.
Current Behavior
The following exception is raised when a global
uv
installation is not available.https://github.com/wntrblm/nox/blob/4c8e89164d90718312e4819a48243797924f55a9/nox/sessions.py#L790
The underlying cause seems to be
shutil.which("uv")
not being able to find uv installed alongside nox.https://github.com/wntrblm/nox/blob/4c8e89164d90718312e4819a48243797924f55a9/nox/virtualenv.py#L563
Expected Behavior
Installing
nox[uv]
is sufficient to use uv as a backend, without relying on a global uv installation.Steps To Reproduce
nox[uv]
uv
as a venv backend, for example by settingnox.options.default_venv_backend = "uv"
in the NoxfileEnvironment
Anything else?
No response