-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conforming to the XDG specification #9985
Comments
I think these all respect XDG... The uv cache at least respects |
I'll try again but was running into path errors unless I explicitly set them in the Dockerfile. I presume this isn't a recent change - they've been respected for quite some time? |
Yeah I think we've respected XDG-first for quite some time. |
Here's the outcome of my testing: $ env | grep -E "^(XDG|UV)_" && uv cache dir && uv python dir && uv tool dir
XDG_BIN_HOME=/opt/bin
XDG_DATA_HOME=/opt/share
XDG_CONFIG_HOME=/opt/config
XDG_CACHE_HOME=/opt/cache
XDG_STATE_HOME=/opt/state
/opt/cache/uv
/opt/share/uv/python
/opt/share/uv/tools I tried searching through the uv docs for either a config print-out which can tell the user where each of the UV_* directories are expected to be mapped, or consistent documentation regarding which XDG_* directories will be used for but wasn't able to track something consistent down. Manually executing tool and python installs leads to these inferred locations: Tools: $ uv tool install tldr && whereis tldr
Resolved 4 packages in 49ms
Prepared 4 packages in 15ms
Installed 4 packages in 4ms
+ colorama==0.4.6
+ shtab==1.7.1
+ termcolor==2.5.0
+ tldr==3.3.0
Installed 1 executable: tldr
tldr: /opt/bin/tldr Python versions: $ uv python install 3.8 && whereis python3.8
Installed Python 3.8.20 in 1.10s
+ cpython-3.8.20-linux-x86_64-gnu
python3.8:
$ export UV_PYTHON_BIN_DIR=${XDG_BIN_HOME}
$ uv python install 3.10 && whereis python3.10
Installed Python 3.10.16 in 1.14s
+ cpython-3.10.16-linux-x86_64-gnu
python3.10:
$ env | grep -E "^(XDG|UV)_"
UV_PYTHON_BIN_DIR=/opt/bin
XDG_BIN_HOME=/opt/bin
XDG_DATA_HOME=/opt/share
XDG_CONFIG_HOME=/opt/config
XDG_CACHE_HOME=/opt/cache
XDG_STATE_HOME=/opt/state Could I get some help with the python bin dir configuration? If so, I'd be happy to make a small PR which adds the appropriate references to the environment variables page. |
I think these are all documented in the help? Like |
We don't install Python binaries into the bin directory without |
Ah, okay. I have been reading the web documentation here: https://docs.astral.sh/uv/configuration/environment/ The references aren't easily traced in those links.
|
Is python bin-linking the only current |
The other preview feature is a build backend. We'll probably talk more about preview features in the documentation in the future, yeah. They're mentioned in the changelog. |
Currently,
uv
prioritizes$HOME/...
paths over$XDG_*
paths in most cases. This behavior is contradictory to the XDG specification.This means when setting
XDG_*
variables in a docker image, for example,UV_*
variables also must be set.Examples of variables which do not automatically use the
XDG_*
specification:Example of a
UV_*
variable mapping to multiple potentialXDG_*
locations: https://docs.astral.sh/uv/configuration/installer/#changing-the-install-pathConsistent environment inheritance would make
uv
easier to configure according to the XDG specification.The text was updated successfully, but these errors were encountered: