Skip to content

docs: fix invalid syntax in some sources examples #10127

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

Merged
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
2 changes: 1 addition & 1 deletion crates/uv-workspace/src/pyproject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ pub struct ToolUv {
example = r#"
[tool.uv.sources]
httpx = { git = "https://github.com/encode/httpx", tag = "0.27.0" }
pytest = { url = "https://files.pythonhosted.org/packages/6b/77/7440a06a8ead44c7757a64362dd22df5760f9b12dc5f11b6188cd2fc27a0/pytest-8.3.3-py3-none-any.whl" }
pytest = { url = "https://files.pythonhosted.org/packages/6b/77/7440a06a8ead44c7757a64362dd22df5760f9b12dc5f11b6188cd2fc27a0/pytest-8.3.3-py3-none-any.whl" }
pydantic = { path = "/path/to/pydantic", editable = true }
"#
)]
Expand Down
33 changes: 6 additions & 27 deletions docs/concepts/projects/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,7 @@ $ uv add git+https://github.com/encode/httpx --tag 0.27.0
dependencies = ["httpx"]

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

Or, a branch:
Expand All @@ -307,10 +304,7 @@ $ uv add git+https://github.com/encode/httpx --branch main
dependencies = ["httpx"]

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

Or, a revision (commit):
Expand All @@ -324,10 +318,7 @@ $ uv add git+https://github.com/encode/httpx --rev 326b9431c761e1ef1e00b9f760d1f
dependencies = ["httpx"]

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

A `subdirectory` may be specified if the package isn't in the repository root.
Expand Down Expand Up @@ -438,11 +429,7 @@ For example, to pull `httpx` from GitHub, but only on macOS, use the following:
dependencies = ["httpx"]

[tool.uv.sources]
httpx = {
git = "https://github.com/encode/httpx",
tag = "0.27.2",
marker = "sys_platform == 'darwin'"
}
httpx = { git = "https://github.com/encode/httpx", tag = "0.27.2", marker = "sys_platform == 'darwin'" }
```

By specifying the marker on the source, uv will still include `httpx` on all platforms, but will
Expand All @@ -462,16 +449,8 @@ dependencies = ["httpx"]

[tool.uv.sources]
httpx = [
{
git = "https://github.com/encode/httpx",
tag = "0.27.2",
marker = "sys_platform == 'darwin'"
},
{
git = "https://github.com/encode/httpx",
tag = "0.24.1",
marker = "sys_platform == 'linux'"
},
{ git = "https://github.com/encode/httpx", tag = "0.27.2", marker = "sys_platform == 'darwin'" },
{ git = "https://github.com/encode/httpx", tag = "0.24.1", marker = "sys_platform == 'linux'" },
]
```

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ See [Dependencies](../concepts/projects/dependencies.md) for more.

[tool.uv.sources]
httpx = { git = "https://github.com/encode/httpx", tag = "0.27.0" }
pytest = { url = "https://files.pythonhosted.org/packages/6b/77/7440a06a8ead44c7757a64362dd22df5760f9b12dc5f11b6188cd2fc27a0/pytest-8.3.3-py3-none-any.whl" }
pytest = { url = "https://files.pythonhosted.org/packages/6b/77/7440a06a8ead44c7757a64362dd22df5760f9b12dc5f11b6188cd2fc27a0/pytest-8.3.3-py3-none-any.whl" }
pydantic = { path = "/path/to/pydantic", editable = true }
```

Expand Down
Loading