Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uv-{add, tree}: Add page #15552

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions pages/common/uv-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# uv add

> Add package dependencies to the project.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please specify what type of project this is for.

> Packages are specified according to <https://peps.python.org/pep-0508/>.
> More information: <https://docs.astral.sh/uv/reference/cli/#uv-add>.
- Add the latest version of a package:

`uv add {{package}}`

- Add multiple packages:

`uv add {{package1 package2 ...}}`

- Add a package with a version requirement:

`uv add {{package>=1.2.3}}`

- Add packages to an optional dependency group, which will be included when published:

`uv add --optional {{optional}} {{package1 package2 ...}}`

- Add packages to a local group, which will not be included when published:

`uv add --group {{group}} {{package1 package2 ...}}`

- Add packages to the dev group, shorthand for `--group dev`:

`uv add --dev {{package1 package2 ...}}`

- Add package as editable:

`uv add --editable {{path/to/package/}}`

- Enable extra when installing package, may be provided multiple times:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Enable extra when installing package, may be provided multiple times:
- Enable an extra when installing package, may be provided multiple times:


`uv add {{package}} --extra {{extra_feature}}`
28 changes: 28 additions & 0 deletions pages/common/uv-tree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# uv tree

> Display project dependencies in a tree format.
> More information: <https://docs.astral.sh/uv/reference/cli/#uv-tree>.

- Show dependency tree for current environment:

`uv tree`

- Show dependency tree for all environments:

`uv tree --universal`

- Show dependency tree up to a certain depth:

`uv tree {{-d|--depth}} {{n}}`

- Show the latest available version for all outdated packages:

`uv tree --outdated`

- Exclude dependencies from the dev group:

`uv tree --no-dev`

- Show the inverted tree, so children are dependents instead of dependencies:

`uv tree --invert`
8 changes: 4 additions & 4 deletions pages/common/uv.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

`uv init`

- Create a new Python project in a directory with the given name:
- Create a new Python project at the specified path:

`uv init {{project_name}}`
`uv init {{path}}`

- Add a new package to the project:
- Add a new dependency to the project:

`uv add {{package}}`

- Remove a package from the project:
- Remove a dependency from the project:

`uv remove {{package}}`

Expand Down
Loading