一键导入
python-uv
Manage Python with uv instead of pip/virtualenv. Use when running Python scripts, installing packages, or creating virtual environments.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Manage Python with uv instead of pip/virtualenv. Use when running Python scripts, installing packages, or creating virtual environments.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run a model through the omni-bench benchmark to MEASURE it — produce a run-artifact and score it, then read the numbers. Use when asked to run, benchmark, measure, evaluate, or "test the results of" a model with omni-bench — ASR (WER/CER, RTFx) or text generation (tok/s, TTFT, prefill tok/s, prompt-cache speedup). Covers the adapter seam (Transcriber/Generator), the prepare→run→score→diff CLI flow, the offline no-download smoke task, and how to interpret each metric. NOT for publishing to a leaderboard (use omni-bench-publish) or changing the framework itself (use omni-bench).
Publish a scored omni-bench result (ASR or text-generation) to a leaderboard platform (e.g. bench.bshk.app) via its write API. Use when asked to publish, upload, submit, or "send a report" for an omni-bench result.json or parity-report.json — sharing ASR WER/RTFx numbers or text-generation TTFT/tok-per-s/prompt-cache numbers. Covers the one modality-agnostic `omni-bench publish` command and the MANDATORY secret handling: the api-key is injected from a secrets manager (1Password `op run` / AgentVault `av run`) at runtime, never read into context, never hardcoded.
Develop the omni-bench benchmark framework (ASR/STT + text generation) built on a producer/scorer split with an open JSON spec as SSOT. Use when working in an omni-bench checkout — changing the JSON schemas, the prepare/producer/scorer/diff pipeline, the adapter seams (Transcriber / Generator), datasets, fixtures, or the Swift producer SDK; or when running and validating benchmark artifacts. Encodes the schema-evolution rules, determinism invariants, commands, and repo gotchas that are easy to get wrong.
Use when generating/managing the offline root signing key or signing & publishing Zamok product keysets from the terminal (the Swift CLI; the ZamokApp GUI is the co-equal interface). Triggers — "generate root key", "rotate root", "publish keyset", "sign keyset", "escrow root key", "zamokctl", "trusted-roots.json", Tish/Zamok license signature setup.
Use when auditing websites or apps for Canadian accessibility law compliance, checking AODA (Ontario) or Accessible Canada Act (federal) requirements, or advising on CAN/ASC-EN 301 549 obligations.
Use when auditing digital products or services for European Accessibility Act (EAA) compliance, checking EN 301 549 conformance, or advising on EU Web Accessibility Directive obligations.
| name | python-uv |
| description | Manage Python with uv instead of pip/virtualenv. Use when running Python scripts, installing packages, or creating virtual environments. |
| version | 1.0.0 |
Expert guidance for using uv - the extremely fast Python package and project manager by Astral. Written in Rust, 10-100x faster than pip. Replaces pip, pip-tools, pipx, poetry, pyenv, and virtualenv.
# Create new project
uv init my-project
cd my-project
# Or initialize in current directory
uv init
Creates standard structure:
my-project/
├── .python-version
├── .gitignore
├── pyproject.toml
├── README.md
└── main.py
# Add dependencies
uv add requests
uv add 'flask>=2.0'
uv add httpx aiofiles # Multiple packages
# Add dev dependencies
uv add --dev pytest ruff mypy
# Add optional dependencies
uv add --optional gui pyqt6
# Remove dependencies
uv remove requests
# Sync environment with lockfile
uv sync
# Update lockfile
uv lock
uv lock --upgrade-package flask # Upgrade specific
# Run script (auto-syncs environment)
uv run main.py
# Run command in project environment
uv run pytest
uv run ruff check .
# Run with env file
uv run --env-file .env main.py
# Run with extra dependencies (not installed)
uv run --with rich main.py
Key insight: Use uv run instead of activating venv. It's faster and ensures sync.
# Install latest Python
uv python install
# Install specific version
uv python install 3.12
uv python install 3.11 3.12 # Multiple versions
# Set as default (creates python/python3 symlinks)
uv python install --default
# List installed versions
uv python list
# Pin project to specific version
uv python pin 3.12
# Run tool without installing
uvx ruff check .
uvx black --check .
# Install tool globally
uv tool install ruff
uv tool install 'httpie>=3.0'
# Upgrade tool
uv tool upgrade ruff
# List installed tools
uv tool list
# Install packages
uv pip install flask
uv pip install -r requirements.txt
# Compile requirements
uv pip compile requirements.in -o requirements.txt
# Show installed packages
uv pip list
uv pip show flask
Input: "Create a new FastAPI project with testing"
uv init fastapi-app
cd fastapi-app
uv add fastapi uvicorn
uv add --dev pytest httpx pytest-asyncio
# main.py
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}
# Run development server
uv run uvicorn main:app --reload
# Run tests
uv run pytest
Input: "Migrate existing project to uv"
# In project directory
uv init
# Import existing dependencies
uv add -r requirements.txt
# Remove old requirements.txt (optional)
rm requirements.txt
# Now use uv.lock for reproducibility
git add uv.lock pyproject.toml
Input: "Run a script with dependencies not in project"
# Run with temporary dependencies
uv run --with pandas --with matplotlib script.py
# Or use inline metadata (PEP 723)
# /// script
# dependencies = ["pandas", "matplotlib"]
# ///
import pandas as pd
import matplotlib.pyplot as plt
# ...
uv run script.py # Auto-installs inline deps
Input: "Setup GitHub Actions with uv"
# .github/workflows/test.yml
name: Test
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
run: uv python install
- name: Install dependencies
run: uv sync --locked --all-extras --dev
- name: Run tests
run: uv run pytest
- name: Run linter
run: uv run ruff check .
Input: "Create Dockerfile with uv"
FROM python:3.12-slim
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Set environment for production
ENV UV_COMPILE_BYTECODE=1
ENV UV_LINK_MODE=copy
WORKDIR /app
# Copy dependency files
COPY pyproject.toml uv.lock ./
# Install dependencies (no dev, locked versions)
RUN uv sync --locked --no-dev --no-install-project
# Copy application
COPY . .
# Install project
RUN uv sync --locked --no-dev
CMD ["uv", "run", "python", "-m", "myapp"]
| Task | Command |
|---|---|
| New project | uv init |
| Add package | uv add <pkg> |
| Add dev dep | uv add --dev <pkg> |
| Remove package | uv remove <pkg> |
| Sync env | uv sync |
| Run script | uv run <script.py> |
| Run command | uv run <cmd> |
| Install Python | uv python install 3.12 |
| Run tool (no install) | uvx <tool> |
| Install tool | uv tool install <tool> |
| Variable | Purpose |
|---|---|
UV_COMPILE_BYTECODE=1 | Compile .pyc (faster startup) |
UV_NO_SYNC=1 | Skip sync in uv run |
UV_LINK_MODE=copy | Copy files instead of hardlink |
UV_MANAGED_PYTHON=1 | Only use uv-managed Python |
uv run instead of activating venvuv.lock for reproducible builds--locked in CI/CD--dev for test/lint dependenciesuvx for one-off tool usageuv run)uv.lock--locked in production| Old Tool | uv Equivalent |
|---|---|
pip install X | uv add X or uv pip install X |
pip install -r requirements.txt | uv add -r requirements.txt |
python script.py | uv run script.py |
pipx run ruff | uvx ruff |
pipx install ruff | uv tool install ruff |
pyenv install 3.12 | uv python install 3.12 |
poetry add X | uv add X |
poetry install | uv sync |
poetry lock | uv lock |