From 5ba0398f9e39a2fdf4532aff049bb00442690408 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Thu, 22 Aug 2024 17:58:57 -0500 Subject: [PATCH] Update the installation documentation page --- docs/getting-started/installation.md | 81 +++++++++++++++++++++------- 1 file changed, 63 insertions(+), 18 deletions(-) diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 285052bb716f..3e302429d540 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -1,9 +1,10 @@ # Installing uv -Install uv with our standalone installers or your package manager of choice (e.g., -`pip install uv`). +## Installation methods -## Standalone installer +Install uv with our standalone installers or your package manager of choice. + +### Standalone installer uv provides a standalone installer to download and install uv: @@ -41,18 +42,7 @@ $ curl -LsSf https://astral.sh/uv/0.3.1/install.sh | sh $ powershell -c "irm https://astral.sh/uv/0.3.1/install.ps1 | iex" ``` -!!! tip - - When uv is installed via the standalone installer, self-updates are enabled: - - ```console - $ uv self update - ``` - - When another installation method is used, self-updates are disabled. Use the package manager's - upgrade method instead. - -## PyPI +### PyPI For convenience, uv is published to [PyPI](https://pypi.org/project/uv/). @@ -75,7 +65,7 @@ $ pip install uv [contributing setup guide](https://github.com/astral-sh/uv/blob/main/CONTRIBUTING.md#setup) for details on building uv from source. -## Homebrew +### Homebrew uv is available in the core Homebrew packages. @@ -83,14 +73,14 @@ uv is available in the core Homebrew packages. $ brew install uv ``` -## Docker +### Docker uv provides a Docker image at [`ghcr.io/astral-sh/uv`](https://github.com/astral-sh/uv/pkgs/container/uv). See our guide on [using uv in Docker](../guides/integration/docker.md) for more details. -## GitHub Releases +### GitHub Releases uv release artifacts can be downloaded directly from [GitHub Releases](https://github.com/astral-sh/uv/releases). @@ -98,6 +88,61 @@ uv release artifacts can be downloaded directly from Each release page includes binaries for all supported platforms as well as instructions for using the standalone installer via `github.com` instead of `astral.sh`. +## Upgrading uv + +When uv is installed via the standalone installer, it can update itself on-demand: + +```console +$ uv self update +``` + +When another installation method is used, self-updates are disabled. Use the package manager's +upgrade method instead. For example, with `pip`: + +```console +$ pip install --upgrade uv +``` + +## Shell autocompletion + +To enable shell autocompletion for uv commands, run one of the following: + +=== "Linux and macOS" + + ```bash + # Determine your shell (e.g., with `echo $SHELL`), then run one of: + echo 'eval "$(uv generate-shell-completion bash)"' >> ~/.bashrc + echo 'eval "$(uv generate-shell-completion zsh)"' >> ~/.zshrc + echo 'uv generate-shell-completion fish | source' >> ~/.config/fish/config.fish + echo 'eval (uv generate-shell-completion elvish | slurp)' >> ~/.elvish/rc.elv + ``` + +=== "Windows" + + ```powershell + Add-Content -Path $PROFILE -Value '(& uv generate-shell-completion powershell) | Out-String | Invoke-Expression + ``` + +Then restart the shell or source the shell config file. + +## Uninstallation + +If you need to remove uv from your system, just remove the `uv` and `uvx` binaries: + +```console +$ rm ~/.cargo/bin/uv ~/.cargo/bin/uvx +``` + +!!! tip + + You may want to remove data that uv has stored before removing the binaries: + + ```console + $ uv cache clean + $ rm -r "$(uv python dir)" + $ rm -r "$(uv tool dir)" + ``` + ## Next steps See the [first steps](./first-steps.md) or jump straight to the [guides](../guides/index.md) to