| created | "2025-12-16T00:00:00.000Z" |
| modified | "2026-05-09T00:00:00.000Z" |
| reviewed | "2026-04-25T00:00:00.000Z" |
| name | uv-advanced-dependencies |
| description | Advanced uv dependencies: Git deps, path deps, editable installs, groups, extras, custom indexes. Use when the user mentions git+https deps, editable installs, or private indexes. |
| user-invocable | false |
| allowed-tools | Bash, Read, Grep, Glob |
UV Advanced Dependencies
Quick reference for advanced dependency scenarios in UV projects.
When to Use This Skill
| Use this skill when... | Use a focused sibling instead when... |
|---|
| Pinning a dependency to a git URL, branch, or tag, or installing in editable mode | Adding a normal PyPI dependency — use uv-project-management |
Configuring [tool.uv.sources], dependency groups, extras, or custom indexes | Sharing source declarations across workspace members — use uv-workspaces |
| Setting up private package indexes or build-time constraints | Running an ephemeral script with --with deps — use uv-run |
When This Skill Applies
- Git repository dependencies
- Local path dependencies
- Editable installations
- Dependency constraints
- Custom package indexes
- Dependency groups and extras
- Build dependencies
Quick Reference
Git Dependencies
uv add git+https://github.com/psf/requests
uv add git+https://github.com/pallets/flask@main
uv add git+ssh://git@github.com/user/repo.git@v1.0.0
uv add git+https://github.com/user/repo@feature-branch
uv add git+https://github.com/user/repo@v2.0.0
uv add git+https://github.com/user/repo@abc123
Path Dependencies
uv add --editable ./local-package
uv add ../another-project
uv add /absolute/path/to/package
uv add --no-editable ./local-package
Dependency Groups
uv add --group docs sphinx mkdocs
uv add --group test pytest pytest-cov
uv sync --group docs
uv sync --group test --group docs
uv sync --all-groups
Extras (Optional Dependencies)
uv add 'fastapi[all]'
uv add 'sqlalchemy[postgresql,mypy]'
[project.optional-dependencies]
dev = ["pytest", "ruff"]
docs = ["mkdocs", "mkdocs-material"]
Constraint Files
uv pip compile requirements.in --constraint constraints.txt
Custom Indexes
[tool.uv]
index-url = "https://pypi.org/simple"
extra-index-url = [
"https://custom.pypi.org/simple",
]
Git Dependencies in pyproject.toml
[project]
dependencies = [
"my-package",
]
[tool.uv.sources]
my-package = { git = "https://github.com/user/my-package" }
my-package = { git = "https://github.com/user/my-package", branch = "main" }
my-package = { git = "https://github.com/user/my-package", tag = "v1.0.0" }
my-package = { git = "https://github.com/user/my-package", rev = "abc123" }
Path Dependencies in pyproject.toml
[project]
dependencies = [
"my-local-package",
]
[tool.uv.sources]
my-local-package = { path = "../my-local-package" }
my-local-package = { path = "../my-local-package", editable = true }
my-local-package = { path = "../my-local-package", editable = false }
Dependency Groups
[dependency-groups]
dev = [
"pytest>=7.0",
"pytest-cov>=4.0",
"ruff>=0.1.0",
]
docs = [
"mkdocs-material>=9.0",
"mkdocstrings[python]>=0.24",
]
test = [
"pytest-asyncio>=0.21",
"pytest-mock>=3.12",
]
URL Dependencies
uv add https://files.pythonhosted.org/packages/.../requests-2.31.0.tar.gz
[tool.uv.sources]
my-package = { url = "https://example.com/my-package-1.0.tar.gz" }
Private Package Indexes
[tool.uv]
index-url = "https://pypi.org/simple"
extra-index-url = [
"https://${PRIVATE_TOKEN}@private.pypi.org/simple",
]
find-links = [
"https://download.pytorch.org/whl/cu118",
]
export PRIVATE_TOKEN="secret"
uv sync
Build Dependencies
[build-system]
requires = [
"setuptools>=68",
"wheel",
"Cython>=3.0",
]
build-backend = "setuptools.build_meta"
Common Patterns
Development from Local Checkout
git clone https://github.com/user/lib.git ../lib
cd my-project
uv add --editable ../lib
Monorepo Path Dependencies
[tool.uv.sources]
my-core = { path = "packages/core" }
my-utils = { path = "packages/utils" }
Mixed Sources
[project]
dependencies = [
"fastapi",
"my-lib",
"my-local",
]
[tool.uv.sources]
my-lib = { git = "https://github.com/user/my-lib" }
my-local = { path = "../my-local" }
Resolution Strategies
[tool.uv]
resolution = "highest"
resolution = "lowest"
resolution = "lowest-direct"
See Also
uv-project-management - Basic dependency management
uv-workspaces - Workspace member dependencies
python-packaging - Build system configuration
References