docs: Update dependencies.md (#12388)

<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary
Fixes #12334
<!-- What's the purpose of the change? What does it do, and why? -->

## Test Plan

<!-- How was it tested? -->
This commit is contained in:
kenwoodjw
2025-03-23 11:06:11 +08:00
committed by GitHub
parent 15bf83ced8
commit cdd6de555b
+6 -6
View File
@@ -1,8 +1,8 @@
# Managing dependencies
## Dependency tables
## Dependency fields
Dependencies of the project are defined in several tables:
Dependencies of the project are defined in several fields:
- [`project.dependencies`](#project-dependencies): Published dependencies.
- [`project.optional-dependencies`](#optional-dependencies): Published optional dependencies, or
@@ -12,7 +12,7 @@ Dependencies of the project are defined in several tables:
!!! note
The `project.dependencies` and `project.optional-dependencies` tables can be used even if
The `project.dependencies` and `project.optional-dependencies` fields can be used even if
project isn't going to be published. `dependency-groups` are a recently standardized feature
and may not be supported by all tools yet.
@@ -27,7 +27,7 @@ To add a dependency:
$ uv add httpx
```
An entry will be added in the `project.dependencies` table:
An entry will be added in the `project.dependencies` field:
```toml title="pyproject.toml" hl_lines="4"
[project]
@@ -38,7 +38,7 @@ dependencies = ["httpx>=0.27.2"]
The [`--dev`](#development-dependencies), [`--group`](#dependency-groups), or
[`--optional`](#optional-dependencies) flags can be used to add a dependencies to an alternative
table.
field.
The dependency will include a constraint, e.g., `>=0.27.2`, for the most recent, compatible version
of the package. An alternative constraint can be provided:
@@ -48,7 +48,7 @@ $ uv add "httpx>=0.20"
```
When adding a dependency from a source other than a package registry, uv will add an entry in the
sources table. For example, when adding `httpx` from GitHub:
sources field. For example, when adding `httpx` from GitHub:
```console
$ uv add "httpx @ git+https://github.com/encode/httpx"