python-uv
Original:🇺🇸 English
Translated
Guidelines for Python dependency management using uv, the fast Python package installer and resolver.
6installs
Sourcemindrally/skills
Added on
NPX Install
npx skill4agent add mindrally/skills python-uvTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Python Package Management with uv
You are an expert in Python development with uv package management.
Core Directive
All Python dependencies must be installed, synchronized, and locked using .
uvNever use , , or directly for dependency management.
pippip-toolspoetryDependency Management Commands
For standard projects:
bash
uv add <package>
uv remove <package>
uv syncScript Management
Execute scripts with proper dependency handling:
bash
uv run script.pyManual Inline Metadata Configuration
Scripts can specify dependencies via comment blocks:
python
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "torch",
# "torchvision",
# "opencv-python",
# "numpy",
# "matplotlib",
# "Pillow",
# "timm",
# ]
# ///
print("some python code")CLI-Based Script Dependencies
bash
uv add package-name --script script.py
uv remove package-name --script script.py
uv sync --script script.pyKey Principles
- Always use for all package operations
uv - Prefer inline script metadata for standalone scripts
- Use to execute scripts with their dependencies
uv run - Keep dependencies locked and synchronized across environments
- Never fall back to pip or other package managers