mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-31 07:47:27 +00:00
Move some documents to relevant sections (#5968)
This commit is contained in:
parent
3228fc5f35
commit
db0b44b88c
7 changed files with 23 additions and 23 deletions
104
docs/getting-started/features.md
Normal file
104
docs/getting-started/features.md
Normal file
|
@ -0,0 +1,104 @@
|
|||
# Features
|
||||
|
||||
uv provides essential features for Python development — from installing Python and hacking on simple
|
||||
scripts to working on large projects that support multiple Python versions and platforms.
|
||||
|
||||
uv's interface can be broken down into sections, which can be used independently or together.
|
||||
|
||||
## Python versions
|
||||
|
||||
Installing and managing Python itself.
|
||||
|
||||
- `uv python install`: Install Python versions.
|
||||
- `uv python list`: View available Python versions.
|
||||
- `uv python find`: Find an installed Python version.
|
||||
- `uv python pin`: Pin the current project to use a specific Python version.
|
||||
- `uv python uninstall`: Uninstall a Python version.
|
||||
|
||||
See the [guide on installing Python](../guides/install-python.md) to get started.
|
||||
|
||||
## Scripts
|
||||
|
||||
Executing standalone Python scripts, e.g., `example.py`.
|
||||
|
||||
- `uv run`: Run a script.
|
||||
|
||||
See the [guide on running scripts](../guides/scripts.md) to get started.
|
||||
|
||||
## Projects
|
||||
|
||||
Creating and working on Python projects, i.e., with a `pyproject.toml`.
|
||||
|
||||
- `uv init`: Create a new Python project.
|
||||
- `uv add`: Add a dependency to the project.
|
||||
- `uv remove`: Remove a dependency from the project.
|
||||
- `uv sync`: Sync the project's dependencies with the environment.
|
||||
- `uv lock`: Create a lockfile for the project's dependencies.
|
||||
- `uv run`: Run a command in the project environment.
|
||||
- `uv tree`: View the dependency tree for the project.
|
||||
|
||||
See the [guide on projects](../guides/projects.md) to get started.
|
||||
|
||||
## Tools
|
||||
|
||||
Running and installing tools published to Python package indexes, e.g., `ruff` or `black`.
|
||||
|
||||
- `uvx` / `uv tool run`: Run a tool in a temporary environment.
|
||||
- `uv tool install`: Install a tool user-wide.
|
||||
- `uv tool uninstall`: Uninstall a tool.
|
||||
- `uv tool list`: List installed tools.
|
||||
- `uv tool update-shell`: Update the shell to include tool executables.
|
||||
|
||||
See the [guide on tools](../guides/tools.md) to get started.
|
||||
|
||||
## The pip interface
|
||||
|
||||
Manually managing environments and packages — intended to be used in legacy workflows or cases where
|
||||
the high-level commands do not provide enough control.
|
||||
|
||||
Creating virtual environments (replacing `venv` and `virtualenv`):
|
||||
|
||||
- `uv venv`: Create a new virtual environment.
|
||||
|
||||
See the documentation on [using environments](../pip/environments.md) for details.
|
||||
|
||||
Managing packages in an environment (replacing [`pip`](https://github.com/pypa/pip) and
|
||||
[`pipdeptree`](https://github.com/tox-dev/pipdeptree)):
|
||||
|
||||
- `uv pip install`: Install packages into the current environment.
|
||||
- `uv pip show`: Show details about an installed package.
|
||||
- `uv pip freeze`: List installed packages and their versions.
|
||||
- `uv pip check`: Check that the current environment has compatible packages.
|
||||
- `uv pip list`: List installed packages.
|
||||
- `uv pip uninstall`: Uninstall packages.
|
||||
- `uv pip tree`: View the dependency tree for the environment.
|
||||
|
||||
See the documentation on [managing packages](../pip/packages.md) for details.
|
||||
|
||||
Locking packages in an environment (replacing [`pip-tools`](https://github.com/jazzband/pip-tools)):
|
||||
|
||||
- `uv pip compile`: Compile requirements into a lockfile.
|
||||
- `uv pip sync`: Sync an environment with a lockfile.
|
||||
|
||||
See the documentation on [locking environments](../pip/compile.md) for details.
|
||||
|
||||
!!! important
|
||||
|
||||
These commands do not exactly implement the interfaces and behavior of the tools they are based on. The further you stray from common workflows, the more likely you are to encounter differences. Consult the [pip-compatibility guide](../pip/compatibility.md) for details.
|
||||
|
||||
## Utility
|
||||
|
||||
Managing and inspecting uv's state, such as the cache, storage directories, or performing a
|
||||
self-update:
|
||||
|
||||
- `uv cache clean`: Remove cache entries.
|
||||
- `uv cache prune`: Remove outdated cache entries.
|
||||
- `uv cache dir`: Show the uv cache directory path.
|
||||
- `uv tool dir`: Show the uv tool directory path.
|
||||
- `uv python dir`: Show the uv installed Python versions path.
|
||||
- `uv self update`: Update uv to the latest version.
|
||||
|
||||
## Next steps
|
||||
|
||||
Read the [guides](../guides/index.md) for an introduction to each feature or check out
|
||||
[concept](../concepts/index.md) pages for in-depth details about uv's features.
|
69
docs/getting-started/first-steps.md
Normal file
69
docs/getting-started/first-steps.md
Normal file
|
@ -0,0 +1,69 @@
|
|||
# First steps with uv
|
||||
|
||||
After [installing uv](./installation.md), you can check that uv is available by running the `uv`
|
||||
command:
|
||||
|
||||
```console
|
||||
$ uv
|
||||
An extremely fast Python package manager.
|
||||
|
||||
Usage: uv [OPTIONS] <COMMAND>
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
You should see a help menu listing the available commands.
|
||||
|
||||
Read on for a brief overview of the help menu and version command, or jump to an
|
||||
[overview of features](./features.md) to start using uv.
|
||||
|
||||
## Help menus
|
||||
|
||||
The `--help` flag can be used to view the help menu for a command, e.g., for `uv`:
|
||||
|
||||
```console
|
||||
$ uv --help
|
||||
```
|
||||
|
||||
To view the help menu for a specific command, e.g., for `uv init`:
|
||||
|
||||
```console
|
||||
$ uv init --help
|
||||
```
|
||||
|
||||
When using the `--help` flag, uv displays a condensed help menu. To view a longer help menu for a
|
||||
command, use `uv help`:
|
||||
|
||||
```console
|
||||
$ uv help
|
||||
```
|
||||
|
||||
To view the long help menu for a specific command, e.g., for `uv init`:
|
||||
|
||||
```console
|
||||
$ uv help init
|
||||
```
|
||||
|
||||
When using the long help menu, uv will attempt to use `less` or `more` to "page" the output so it is
|
||||
not all displayed at once. To exit the pager, press `q`.
|
||||
|
||||
## Viewing the version
|
||||
|
||||
To check the installed version:
|
||||
|
||||
```console
|
||||
$ uv version
|
||||
```
|
||||
|
||||
The following are also valid:
|
||||
|
||||
```console
|
||||
$ uv --version # Same output as `uv version`
|
||||
$ uv -V # Will not include the build commit and date
|
||||
$ uv pip --version # Can be used with a subcommand
|
||||
```
|
||||
|
||||
## Next steps
|
||||
|
||||
Now that you've confirmed uv is installed and know how to get help, check out an
|
||||
[overview of features](./features.md) or jump to the [guides](../guides/index.md) to start using uv.
|
104
docs/getting-started/installation.md
Normal file
104
docs/getting-started/installation.md
Normal file
|
@ -0,0 +1,104 @@
|
|||
# Installing uv
|
||||
|
||||
Install uv with our standalone installers or your package manager of choice (e.g.,
|
||||
`pip install uv`).
|
||||
|
||||
## Standalone installer
|
||||
|
||||
uv provides a standalone installer to download and install uv:
|
||||
|
||||
```console title="macOS and Linux"
|
||||
$ curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
```
|
||||
|
||||
```console title="Windows"
|
||||
$ powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
|
||||
```
|
||||
|
||||
By default, uv is installed to `~/.cargo/bin`.
|
||||
|
||||
!!! tip
|
||||
|
||||
The installation script may be inspected before use:
|
||||
|
||||
```console title="macOS and Linux"
|
||||
$ curl -LsSf https://astral.sh/uv/install.sh | less
|
||||
```
|
||||
|
||||
```console title="Windows"
|
||||
$ powershell -c "irm https://astral.sh/uv/install.ps1 | more"
|
||||
```
|
||||
|
||||
Alternatively, the installer or binaries can be downloaded directly from [GitHub](#github-releases).
|
||||
|
||||
Request a specific version by including it in the URL:
|
||||
|
||||
```console title="macOS and Linux"
|
||||
$ curl -LsSf https://astral.sh/uv/0.2.11/install.sh | sh
|
||||
```
|
||||
|
||||
```console title="Windows"
|
||||
$ powershell -c "irm https://astral.sh/uv/0.2.11/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
|
||||
|
||||
For convenience, uv is published to [PyPI](https://pypi.org/project/uv/).
|
||||
|
||||
If installing from PyPI, we recommend installing uv into an isolated environment, e.g., with `pipx`:
|
||||
|
||||
```console
|
||||
$ pipx install uv
|
||||
```
|
||||
|
||||
However, `pip` can also be used:
|
||||
|
||||
```console
|
||||
$ pip install uv
|
||||
```
|
||||
|
||||
!!! note
|
||||
|
||||
uv ships with prebuilt distributions (wheels) for many platforms; if a wheel is not available for a given
|
||||
platform, uv will be built from source, which requires a Rust toolchain. See the
|
||||
[contributing setup guide](https://github.com/astral-sh/uv/blob/main/CONTRIBUTING.md#setup)
|
||||
for details on building uv from source.
|
||||
|
||||
## Homebrew
|
||||
|
||||
uv is available in the core Homebrew packages.
|
||||
|
||||
```console
|
||||
$ brew install uv
|
||||
```
|
||||
|
||||
## 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
|
||||
|
||||
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`.
|
||||
|
||||
## Next steps
|
||||
|
||||
See the [first steps](./first-steps.md) or jump straight to the [guides](../guides/index.md) to
|
||||
start using uv.
|
Loading…
Add table
Add a link
Reference in a new issue