Skip to content

Commit e3a0988

Browse files
authored
docs(git): add subdirectory example (#10894)
## Summary Closes #10889. As kinda hinted in the issue, would adding a `--subdirectory` flag to `uv add` make sense? This would IMO be more discoverable. ## Test Plan Ran the command added to the documentation: ```console $ uv add git+https://github.com/langchain-ai/langchain#subdirectory=libs/langchain Resolved 40 packages in 203ms Built langchain @ git+https://github.com/langchain-ai/langchain@f2ea62f63209130bfc56b1fe7d0fa7c299bbf352#subdirectory=libs/langchain Prepared 19 packages in 837ms Installed 37 packages in 14ms [...] ```
1 parent 53706a1 commit e3a0988

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/concepts/projects/dependencies.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,19 @@ dependencies = ["httpx"]
321321
httpx = { git = "https://github.com/encode/httpx", rev = "326b9431c761e1ef1e00b9f760d1f654c8db48c6" }
322322
```
323323

324-
A `subdirectory` may be specified if the package isn't in the repository root.
324+
A `subdirectory` may be specified if the package isn't in the repository root:
325+
326+
```console
327+
$ uv add git+https://github.com/langchain-ai/langchain#subdirectory=libs/langchain
328+
```
329+
330+
```toml title="pyproject.toml"
331+
[project]
332+
dependencies = ["langchain"]
333+
334+
[tool.uv.sources]
335+
langchain = { git = "https://github.com/langchain-ai/langchain", subdirectory = "libs/langchain" }
336+
```
325337

326338
### URL
327339

0 commit comments

Comments
 (0)