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

Improve documentation of manually adding branch, rev, and tag #8497

Merged
merged 6 commits into from
Oct 23, 2024
Merged
Changes from 5 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
42 changes: 40 additions & 2 deletions docs/concepts/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ dependencies = [
httpx = { git = "https://github.com/encode/httpx" }
```

A revision, tag, or branch may also be included:
A revision (i.e., commit), tag, or branch may also be included:

```console
$ uv add git+https://github.com/encode/httpx --tag 0.27.0
Expand All @@ -145,7 +145,45 @@ $ uv add git+https://github.com/encode/httpx --rev 326b943
```

Git dependencies can also be manually added or edited in the `pyproject.toml` with the
`{ git = <url> }` syntax. A target revision may be specified with one of: `rev`, `tag`, or `branch`.
`{ git = <url> }` syntax. A target revision may be specified with one of: `tag`, `branch`, or `rev`
(i.e., commit).

=== "tag"

```toml title="pyproject.toml"
[project]
dependencies = [
"httpx",
]

[tool.uv.sources]
httpx = { git = "https://github.com/encode/httpx", tag = "0.27.0" }
```

=== "branch"

```toml title="pyproject.toml"
[project]
dependencies = [
"httpx",
]

[tool.uv.sources]
httpx = { git = "https://github.com/encode/httpx", branch = "main" }
```

=== "rev"

```toml title="pyproject.toml"
[project]
dependencies = [
"httpx",
]

[tool.uv.sources]
httpx = { git = "https://github.com/encode/httpx", rev = "326b943" }
```

A `subdirectory` may be specified if the package isn't in the repository root.

### URL
Expand Down
Loading