Skip to content

Commit

Permalink
Add note about environments
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Jul 15, 2024
1 parent 09c78b5 commit 304bf82
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/guides/tools.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Using tools

Many Python packages provide command-line tools. uv has specialized support for invoking tools provided by these packages.
Many Python packages provide command-line tools. uv has specialized support for invoking tools provided by these packages without installing them into your environment.

## Using `uvx`

Expand Down Expand Up @@ -95,7 +95,7 @@ However, there are a couple notable differences when using uv's tool interface:

## Installing tools

If a tool is used often, it can be useful to install it to a persistent environment instead of invoking `uvx` repeatedly.
If a tool is used often, it can be useful to install it to a persistent environment instead of invoking `uvx` repeatedly.

To install `ruff`:

Expand All @@ -111,6 +111,14 @@ After installing `ruff`, it should be available:
$ ruff --version
```

Unlike `uv pip install`, installing a tool does not make its modules available in the current environment. For example, the following command will fail:

```console
$ python -c "import ruff"
```

This isolation is important for reducing interactions and conflicts between dependencies of tools, scripts, and projects.

Unlike `uvx`, `uv tool install` operates on a _package_ and will install all executables provided by the tool.

For example, the following will install the `http`, `https`, and `httpie` executables:
Expand Down

0 comments on commit 304bf82

Please sign in to comment.