-
Notifications
You must be signed in to change notification settings - Fork 856
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
Store Python toolchains under XDG directory on macOS #4411
Comments
We're talking about it e.g. #2236 and #3049 and astral-sh/ruff#10739 I think it's fairly clear that people prefer the XDG directory for configuration on macOS but I'm not sure what to think of application "state" like this. |
Personally I'm pretty interested it's just weird to go against the platform standard and notably our cache is also not using the XDG directory on macOS. |
Thanks for the prompt reply! As far as Python interpreter discovery, what do you plan to support? Anyway, feel free to close this 😊 |
I'm happy to leave it open to gauge interest. Maybe we need a special toggle. Python interpreter discovery is a whole thing :) I don't think we should chat about it in the issue, but you could take a look at the supported sources. #4198 will address your question about the system interpreters being listed. |
+1 for |
Just chiming in here to say that I'd rather keep the current behavior. XDG is not relevant for macOS and I'd like uv to follow the platform's standards, not those of a Linux system. That said, I have not yet read any of the referenced issues / discussions. |
I see your point, but there are already plenty of programs that, if XDG_* vars are set on macos, will comply with that. It's handy because as a developer it improves the way I manage things (dotfiles, knowing where to go when I need to free up ram...). I don't remember how it ended up there, but there are a bunch of It's also fair to say there are plenty of programs that don't care. VSCode, for example, slams everything under EDIT: My point is: it feels it's more of a standard for GUIs/Applications than programs. |
@baggiponte I absolutely agree that many programs don't respect the OS conventions 😃 When developing Python packages, for example, I therefore make use of best wishes! |
To be clear - as long as the |
Ah! Got you! Yes this does make sense. |
For context, we do use XDG for configuration file discovery so there's some precedent there. |
Another datapoint is that |
Speaking of, tools that are installed with |
Tool installation places binaries entry points according to the XDG specification on all platforms Lines 264 to 275 in 13b0beb
But that doesn't mean we need to place the virtual environment there. Regardless, I'm leaning towards switching to XDG entirely on macOS. |
@zanieb - We still may need something like |
I've opened a pull request to support the variable if set #4769 |
## Summary This PR moves us to the Linux strategy for our global directories on macOS. We both feel on the team _and_ have received feedback (in Issues and Polls) that the `Application Support` directories are more intended for GUIs, and CLI tools are correct to respect the XDG variables and use the same directory paths on Linux and macOS. Namely, we now use: - `/Users/crmarsh/.local/share/uv/tools` (for tools) - `/Users/crmarsh/.local/share/uv/python` (for Pythons) - `/Users/crmarsh/.cache/uv` (for the cache) The strategy is such that if the `/Users/crmarsh/Library/Application Support/uv` already exists, we keep using it -- same goes for `/Users/crmarsh/Library/Caches/uv`, so **it's entirely backwards compatible**. If you want to force a migration to the new schema, you can run: - `uv cache clean` - `uv tool uninstall --all` - `uv python uninstall --all` Which will clean up the macOS-specific directories, paving the way for the above paths. In other words, once you run those commands, subsequent `uv` operations will automatically use the `~/.cache` and `~/.local` variants. Closes #4411. --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
This PR moves us to the Linux strategy for our global directories on macOS. We both feel on the team _and_ have received feedback (in Issues and Polls) that the `Application Support` directories are more intended for GUIs, and CLI tools are correct to respect the XDG variables and use the same directory paths on Linux and macOS. Namely, we now use: - `/Users/crmarsh/.local/share/uv/tools` (for tools) - `/Users/crmarsh/.local/share/uv/python` (for Pythons) - `/Users/crmarsh/.cache/uv` (for the cache) The strategy is such that if the `/Users/crmarsh/Library/Application Support/uv` already exists, we keep using it -- same goes for `/Users/crmarsh/Library/Caches/uv`, so **it's entirely backwards compatible**. If you want to force a migration to the new schema, you can run: - `uv cache clean` - `uv tool uninstall --all` - `uv python uninstall --all` Which will clean up the macOS-specific directories, paving the way for the above paths. In other words, once you run those commands, subsequent `uv` operations will automatically use the `~/.cache` and `~/.local` variants. Closes #4411. --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
This PR moves us to the Linux strategy for our global directories on macOS. We both feel on the team _and_ have received feedback (in Issues and Polls) that the `Application Support` directories are more intended for GUIs, and CLI tools are correct to respect the XDG variables and use the same directory paths on Linux and macOS. Namely, we now use: - `/Users/crmarsh/.local/share/uv/tools` (for tools) - `/Users/crmarsh/.local/share/uv/python` (for Pythons) - `/Users/crmarsh/.cache/uv` (for the cache) The strategy is such that if the `/Users/crmarsh/Library/Application Support/uv` already exists, we keep using it -- same goes for `/Users/crmarsh/Library/Caches/uv`, so **it's entirely backwards compatible**. If you want to force a migration to the new schema, you can run: - `uv cache clean` - `uv tool uninstall --all` - `uv python uninstall --all` Which will clean up the macOS-specific directories, paving the way for the above paths. In other words, once you run those commands, subsequent `uv` operations will automatically use the `~/.cache` and `~/.local` variants. Closes #4411. --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
This PR moves us to the Linux strategy for our global directories on macOS. We both feel on the team _and_ have received feedback (in Issues and Polls) that the `Application Support` directories are more intended for GUIs, and CLI tools are correct to respect the XDG variables and use the same directory paths on Linux and macOS. Namely, we now use: - `/Users/crmarsh/.local/share/uv/tools` (for tools) - `/Users/crmarsh/.local/share/uv/python` (for Pythons) - `/Users/crmarsh/.cache/uv` (for the cache) The strategy is such that if the `/Users/crmarsh/Library/Application Support/uv` already exists, we keep using it -- same goes for `/Users/crmarsh/Library/Caches/uv`, so **it's entirely backwards compatible**. If you want to force a migration to the new schema, you can run: - `uv cache clean` - `uv tool uninstall --all` - `uv python uninstall --all` Which will clean up the macOS-specific directories, paving the way for the above paths. In other words, once you run those commands, subsequent `uv` operations will automatically use the `~/.cache` and `~/.local` variants. Closes #4411. --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
This PR moves us to the Linux strategy for our global directories on macOS. We both feel on the team _and_ have received feedback (in Issues and Polls) that the `Application Support` directories are more intended for GUIs, and CLI tools are correct to respect the XDG variables and use the same directory paths on Linux and macOS. Namely, we now use: - `/Users/crmarsh/.local/share/uv/tools` (for tools) - `/Users/crmarsh/.local/share/uv/python` (for Pythons) - `/Users/crmarsh/.cache/uv` (for the cache) The strategy is such that if the `/Users/crmarsh/Library/Application Support/uv` already exists, we keep using it -- same goes for `/Users/crmarsh/Library/Caches/uv`, so **it's entirely backwards compatible**. If you want to force a migration to the new schema, you can run: - `uv cache clean` - `uv tool uninstall --all` - `uv python uninstall --all` Which will clean up the macOS-specific directories, paving the way for the above paths. In other words, once you run those commands, subsequent `uv` operations will automatically use the `~/.cache` and `~/.local` variants. Closes #4411. --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
Hey there! Thanks for the amazing work. Using
uv
preview features and love it.I noticed
uv toolchain
installs under$HOME/Library/Application Support
. How doesuv
feel about following XDG spec? I saw ruff is doing it. For example,rye
installs under$HOME/.local/share
.Also when I do
uv toolchain list
I get this result:warning: `uv toolchain list` is experimental and may change without warning. cpython-3.12.4-macos-aarch64-none /opt/homebrew/opt/python@3.12/bin/python3.12 cpython-3.12.3-macos-aarch64-none /Users/luca/Library/Application Support/uv/toolchains/cpython-3.12.3-macos-aarch64-none/install/bin/python3 cpython-3.11.9-macos-aarch64-none /Users/luca/Library/Application Support/uv/toolchains/cpython-3.11.9-macos-aarch64-none/install/bin/python3 cpython-3.10.14-macos-aarch64-none /Users/luca/Library/Application Support/uv/toolchains/cpython-3.10.14-macos-aarch64-none/install/bin/python3 cpython-3.9.19-macos-aarch64-none /Users/luca/Library/Application Support/uv/toolchains/cpython-3.9.19-macos-aarch64-none/install/bin/python3 cpython-3.9.6-macos-aarch64-none /Library/Developer/CommandLineTools/usr/bin/python3 cpython-3.8.19-macos-aarch64-none /Users/luca/Library/Application Support/uv/toolchains/cpython-3.8.19-macos-aarch64-none/install/bin/python3
i.e. also Homebrew Python.
(I guess a
uv pin
oruv local
command is coming soon, looking forward to it.)The text was updated successfully, but these errors were encountered: