Skip to content

Commit

Permalink
Update the installation documentation page (#6468)
Browse files Browse the repository at this point in the history
Adds installation of autocompletion, uninstallation, and upgrades.
  • Loading branch information
zanieb committed Aug 22, 2024
1 parent 4576909 commit 30e5336
Showing 1 changed file with 63 additions and 18 deletions.
81 changes: 63 additions & 18 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
@@ -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:

Expand Down Expand Up @@ -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/).

Expand All @@ -75,29 +65,84 @@ $ 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.

```console
$ 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).

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
Expand Down

0 comments on commit 30e5336

Please sign in to comment.