mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Document the tool upgrade
command (#5947)
This commit is contained in:
parent
eed23be1bd
commit
7a0b610c19
2 changed files with 51 additions and 12 deletions
|
@ -40,33 +40,48 @@ Tool environments are placed in a directory with the same name as the tool packa
|
|||
Tool environments are _not_ intended to be mutated directly. It is strongly recommended never to
|
||||
mutate a tool environment manually with a `pip` operation.
|
||||
|
||||
Tool environments may be either mutated or re-created by subsequent `uv tool install` operations.
|
||||
|
||||
To upgrade a single package in a tool environment:
|
||||
|
||||
```console
|
||||
$ uv tool install black --upgrade-package click
|
||||
```
|
||||
Tool environments may be upgraded via `uv tool upgrade`, or re-created entirely via subsequent
|
||||
`uv tool install` operations.
|
||||
|
||||
To upgrade all packages in a tool environment
|
||||
|
||||
```console
|
||||
$ uv tool install black --upgrade
|
||||
$ uv tool upgrade black
|
||||
```
|
||||
|
||||
To reinstall a single package in a tool environment:
|
||||
To upgrade a single package in a tool environment:
|
||||
|
||||
```console
|
||||
$ uv tool install black --reinstall-package click
|
||||
$ uv tool upgrade black --upgrade-package click
|
||||
```
|
||||
|
||||
To reinstall all packages in a tool environment
|
||||
|
||||
```console
|
||||
$ uv tool install black --reinstall
|
||||
$ uv tool upgrade black --reinstall
|
||||
```
|
||||
|
||||
All tool environment mutations will reinstall the tool executables, even if they have not changed.
|
||||
To reinstall a single package in a tool environment:
|
||||
|
||||
```console
|
||||
$ uv tool upgrade black --reinstall-package click
|
||||
```
|
||||
|
||||
Tool upgrades will respect the version constraints provided when installing the tool. For example,
|
||||
`uv tool install black >=23,<24` followed by `uv tool upgrade black` will upgrade Black to the
|
||||
latest version in the range `>=23,<24`.
|
||||
|
||||
To instead replace the version constraints, re-install the tool with `uv tool install`:
|
||||
|
||||
```console
|
||||
$ uv tool install black>=24
|
||||
```
|
||||
|
||||
Similarly, tool upgrades will retain the settings provided when installing the tool. For example,
|
||||
`uv tool install black --prelease allow` followed by `uv tool upgrade black` will retain the
|
||||
`--prelease allow` setting.
|
||||
|
||||
Tool upgrades will reinstall the tool executables, even if they have not changed.
|
||||
|
||||
### Including additional dependencies
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue