mirror of
https://github.com/astral-sh/uv
synced 2026-01-21 21:40:11 -05:00
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 <tom@astral.sh>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user