Skip to content

Commit b24fb77

Browse files
authored
docs: fix invalid syntax in some sources examples (#10127)
## Summary TOML 1.0 doesn't support multi-line for inline tables, so those examples are invalid.
1 parent 755ca8e commit b24fb77

File tree

3 files changed

+8
-29
lines changed

3 files changed

+8
-29
lines changed

crates/uv-workspace/src/pyproject.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ pub struct ToolUv {
292292
example = r#"
293293
[tool.uv.sources]
294294
httpx = { git = "https://github.com/encode/httpx", tag = "0.27.0" }
295-
pytest = { url = "https://files.pythonhosted.org/packages/6b/77/7440a06a8ead44c7757a64362dd22df5760f9b12dc5f11b6188cd2fc27a0/pytest-8.3.3-py3-none-any.whl" }
295+
pytest = { url = "https://files.pythonhosted.org/packages/6b/77/7440a06a8ead44c7757a64362dd22df5760f9b12dc5f11b6188cd2fc27a0/pytest-8.3.3-py3-none-any.whl" }
296296
pydantic = { path = "/path/to/pydantic", editable = true }
297297
"#
298298
)]

docs/concepts/projects/dependencies.md

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,7 @@ $ uv add git+https://github.com/encode/httpx --tag 0.27.0
290290
dependencies = ["httpx"]
291291

292292
[tool.uv.sources]
293-
httpx = {
294-
git = "https://github.com/encode/httpx",
295-
tag = "0.27.0"
296-
}
293+
httpx = { git = "https://github.com/encode/httpx", tag = "0.27.0" }
297294
```
298295

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

309306
[tool.uv.sources]
310-
httpx = {
311-
git = "https://github.com/encode/httpx",
312-
branch = "main"
313-
}
307+
httpx = { git = "https://github.com/encode/httpx", branch = "main" }
314308
```
315309

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

326320
[tool.uv.sources]
327-
httpx = {
328-
git = "https://github.com/encode/httpx",
329-
rev = "326b9431c761e1ef1e00b9f760d1f654c8db48c6"
330-
}
321+
httpx = { git = "https://github.com/encode/httpx", rev = "326b9431c761e1ef1e00b9f760d1f654c8db48c6" }
331322
```
332323

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

440431
[tool.uv.sources]
441-
httpx = {
442-
git = "https://github.com/encode/httpx",
443-
tag = "0.27.2",
444-
marker = "sys_platform == 'darwin'"
445-
}
432+
httpx = { git = "https://github.com/encode/httpx", tag = "0.27.2", marker = "sys_platform == 'darwin'" }
446433
```
447434

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

463450
[tool.uv.sources]
464451
httpx = [
465-
{
466-
git = "https://github.com/encode/httpx",
467-
tag = "0.27.2",
468-
marker = "sys_platform == 'darwin'"
469-
},
470-
{
471-
git = "https://github.com/encode/httpx",
472-
tag = "0.24.1",
473-
marker = "sys_platform == 'linux'"
474-
},
452+
{ git = "https://github.com/encode/httpx", tag = "0.27.2", marker = "sys_platform == 'darwin'" },
453+
{ git = "https://github.com/encode/httpx", tag = "0.24.1", marker = "sys_platform == 'linux'" },
475454
]
476455
```
477456

docs/reference/settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ See [Dependencies](../concepts/projects/dependencies.md) for more.
293293

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

0 commit comments

Comments
 (0)