Open NathanVaughn opened 2 weeks ago
@NathanVaughn Do this instead:
ENV UV_TOOL_DIR=
ENV UV_TOOL_BIN_DIR=
I tried that as well and it has the same result. The easy fix is to just redefine it back to the default like
ENV UV_TOOL_DIR=/root/.local/share/uv/tools
ENV UV_TOOL_BIN_DIR=/root/.local/bin
Sounds like a bug to me then
Hello,
I noticed that
uv
treats the environment variablesUV_TOOL_DIR
andUV_TOOL_BIN_DIR
differently when they exist, but are set to blank values. I was trying to make a devcontainer with some tools pre-installed by uv in a different directory, so that the user's home directory could be cached separately as a mounted volume. Simplified Dockerfile:Running
unset UV_TOOL_DIR
doesn't do anything in this context (see this thread), so I set the environment variables to a blank value instead.Now, running the following commands get this output:
With
uv tool dir
returning a blank value, installing or running a tool now installs it in the current directory. However,uv tool dir --bin
does what I would expect.I believe this is a bug, and
UV_TOOL_DIR
set to a blank value should be treated as unset, and default to the fallback options like$HOME/.local/share/uv/tools
on UNIX, as described at https://docs.astral.sh/uv/reference/cli/#uv-tool-dir