From 8d691f8a4bb4a4ad720a26768fe0d750e75c6b6e Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Fri, 19 Dec 2025 08:07:39 -0600 Subject: [PATCH] Add a sources example to the uv pip migration guide (#17183) Documents https://github.com/astral-sh/uv/issues/6275 --------- Co-authored-by: Tomasz Kramkowski --- docs/guides/migration/pip-to-project.md | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/guides/migration/pip-to-project.md b/docs/guides/migration/pip-to-project.md index 1356cb5d7..fe0121011 100644 --- a/docs/guides/migration/pip-to-project.md +++ b/docs/guides/migration/pip-to-project.md @@ -437,6 +437,33 @@ a `docs` group: $ uv add -r requirements-docs.in -c requirements-docs.txt --group docs ``` +#### Importing dependency sources + +When importing requirements on local paths or Git repositories, for example: + +```python title="requirements.in" +./path-dep +-e ./editable-path-dep +git-dep @ git+https://github.com/astral-sh/git-dep +``` + +uv will map them to [dependency sources](../../concepts/projects/dependencies.md#dependency-sources) +in the `[tool.uv.sources]` table of the `pyproject.toml`: + +```toml title="pyproject.toml" +[project] +dependencies = [ + "path-dep", + "editable-path-dep", + "git-dep", +] + +[tool.uv.sources] +path-dep = { path = "./path-dep" } +editable-path-dep = { path = "../editable-path-dep", editable = true } +git-dep = { git = "https://github.com/astral-sh/git-dep" } +``` + ### Project environments Unlike `pip`, uv is not centered around the concept of an "active" virtual environment. Instead, uv