mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-13 17:25:41 +00:00
Improve documentation of manually adding branch, rev, and tag (#8497)
Closes #8490 by improving the documentation to make it more obvious how to manually edit the `pyproject.toml` if you want to explicitly set the branch, rev (commit), or tag. --------- Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
This commit is contained in:
parent
72185baf70
commit
109abf5037
1 changed files with 41 additions and 3 deletions
|
|
@ -136,16 +136,54 @@ dependencies = [
|
||||||
httpx = { git = "https://github.com/encode/httpx" }
|
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
|
```console
|
||||||
$ uv add git+https://github.com/encode/httpx --tag 0.27.0
|
$ uv add git+https://github.com/encode/httpx --tag 0.27.0
|
||||||
$ uv add git+https://github.com/encode/httpx --branch main
|
$ uv add git+https://github.com/encode/httpx --branch main
|
||||||
$ uv add git+https://github.com/encode/httpx --rev 326b943
|
$ uv add git+https://github.com/encode/httpx --rev 326b9431c761e1ef1e00b9f760d1f654c8db48c6
|
||||||
```
|
```
|
||||||
|
|
||||||
Git dependencies can also be manually added or edited in the `pyproject.toml` with the
|
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: `rev` (i.e., commit),
|
||||||
|
`tag`, or `branch`.
|
||||||
|
|
||||||
|
=== "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 = "326b9431c761e1ef1e00b9f760d1f654c8db48c6" }
|
||||||
|
```
|
||||||
|
|
||||||
A `subdirectory` may be specified if the package isn't in the repository root.
|
A `subdirectory` may be specified if the package isn't in the repository root.
|
||||||
|
|
||||||
### URL
|
### URL
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue