About python-uv
A development skill for managing Python dependencies and scripts with uv. It establishes consistent commands for adding, removing, syncing, locking, and running dependencies, including standalone scripts.
Key features
- 01Manage dependencies with uv
- 02Synchronize project environments
- 03Lock dependencies
- 04Run scripts with dependencies
- 05Configure inline script metadata
Use cases
- 01Set up dependencies for a Python project
- 02Keep environments synchronized
- 03Run a standalone script with declared dependencies
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ mindrally/ skills --skill python-uvAfter installing, type/python-uvin Claude Code to confirm it loaded.
Details
From the project READMEPython 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 uv.
Never use pip, pip-tools, or poetry directly for dependency management.
Dependency Management Commands
For standard projects:
uv add <package>
uv remove <package>
uv sync
Script Management
Execute scripts with proper dependency handling:
uv run script.py
Manual Inline Metadata Configuration
Scripts can specify dependencies via comment blocks:
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "torch",
# "torchvision",
# "opencv-python",
# "numpy",
# "matplotlib",
# "Pillow",
# "timm",
# ]
# ///
print("some python code")
CLI-Based Script Dependencies
uv add package-name --script script.py
uv remove package-name --script script.py
uv sync --script script.py
Key Principles
- Always use
uvfor all package operations - Prefer inline script metadata for standalone scripts
- Use
uv runto execute scripts with their dependencies - Keep dependencies locked and synchronized across environments
- Never fall back to pip or other package managers
Comments
Markdown supported