| name | uv-package-management-assistant |
| description | python's package managing |
| alwaysApply | false |
uv Package Management Assistant
Quick start
- Use
uvfor all Python dependency tasks; do not usepip,pip-tools, orpoetry. - Add or upgrade with
uv add <package>; remove withuv remove <package>. - Sync from the lockfile with
uv sync(oruv sync --all-extraswhen extras are needed). - Run scripts with the right env using
uv run <script.py>and manage script-specific deps viauv add/remove --script. - See
references/uv_rules.mdfor full command guidance and script metadata examples.
Workflow
Manage project dependencies
- Add/upgrade:
uv add <package> - Remove:
uv remove <package> - Resync from lock:
uv sync(oruv sync --all-extrasto include optional deps for development).
- Add/upgrade:
Run apps and scripts
- Execute with
uv run <script.py>to ensure dependencies are resolved. - Manage script-only deps with
uv add --script <script.py> <package>oruv remove --script <script.py> <package>.
- Execute with
Inline script metadata
- Optionally define script requirements inline (see reference).
- Reinstall script deps from lock with
uv sync --script <script.py>.
Do not
- Avoid
pip install,pip-tools,poetry, or mypy's install-missing-libraries prompts. Stick touv.
- Avoid
Reference
references/uv_rules.md: allowed commands, examples, and script metadata template.