export UV_CACHE_DIR="~/uv_cache"
# Use uv
uv venv
uv pip install numpy
Will produce a subfolder '~' with 'uv_cache' in it instead of expanding to /home/user/uv_cache when used.
Note: Since shells will often expand the tildes themselves this may not often be a problem. In the above example, using export UV_CACHE_DIR=~/uv_cache (without the ""), works as my shell expands the ~ before setting the env variable.
I ran into this issue because I was trying to use astral-sh/setup-uv with cache-local-path: ~/.uv_cache which then is used to set UV_CACHE_DIR. Unfortunately here, whether I include the "" or not, the env variable gets set with the ~ giving me the wrong cache dir.
I think it would be useful to support ~ at the start of paths for UV_CACHE_DIR and other similar path environment variables (untested but I'm guessing they have the same limitation).
Will produce a subfolder
'~'with'uv_cache'in it instead of expanding to/home/user/uv_cachewhen used.Note: Since shells will often expand the tildes themselves this may not often be a problem. In the above example, using
export UV_CACHE_DIR=~/uv_cache(without the ""), works as my shell expands the~before setting the env variable.I ran into this issue because I was trying to use
astral-sh/setup-uvwithcache-local-path: ~/.uv_cachewhich then is used to setUV_CACHE_DIR. Unfortunately here, whether I include the "" or not, the env variable gets set with the~giving me the wrong cache dir.I think it would be useful to support
~at the start of paths forUV_CACHE_DIRand other similar path environment variables (untested but I'm guessing they have the same limitation).