Token导航 LogoToken导航TokenDH.com
前端设计敏感数据github未标认证来源可访问许可证需确认审计提醒

python-uvPython UV 测试

Agent Skill

用于辅助 Python 项目开发、测试、依赖管理和常见框架工作流。它适合让 Agent 阅读 Python 代码、定位测试问题、整理运行命令、生成脚本或分析数据处理逻辑。使用时需要确认项目虚拟环境、依赖版本和测试入口;涉及执行脚本、读写文件、访问数据库或调用外部 API 时,应先明确运行目录和输入输出范围,避免误改生产数据。

总安装

220

周安装

9

GitHub Stars

2

下载量

71
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:python-uv(Python UV 测试)
来源仓库:https://github.com/beshkenadze/claude-skills-marketplace
仓库路径:skills/python-uv
安装命令:
npx skills add https://github.com/beshkenadze/claude-skills-marketplace --skill python-uv
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/beshkenadze/claude-skills-marketplace --skill python-uv

简介

基于 Astral 的极速 Python 包管理与项目初始化工具,替代 pip/poetry/pyenv。

  • 适合新项目搭建、依赖锁定或多环境隔离的快速部署场景。
  • 支持单命令添加依赖、创建虚拟环境与生成 pyproject.toml 文件。
  • 首次使用需全局安装 uv,并确保 Python 3.7+ 环境已正确配置。
  • python-uv 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Python uv

Overview

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.

Instructions

1. New Project Setup

# 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

2. Dependency Management

# 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

3. Running Code

# 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.

4. Python Version Management

# 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

5. Tool Management (replaces pipx)

# 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

6. pip Interface (for compatibility)

# 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

Examples

Example: Create FastAPI Project

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

Example: Migrate from requirements.txt

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

Example: Run One-off Script

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

Example: CI/CD Setup

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 .

Example: Docker Production

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"]

Quick Reference

TaskCommand
New projectuv init
Add packageuv add <pkg>
Add dev depuv add --dev <pkg>
Remove packageuv remove <pkg>
Sync envuv sync
Run scriptuv run <script.py>
Run commanduv run <cmd>
Install Pythonuv python install 3.12
Run tool (no install)uvx <tool>
Install tooluv tool install <tool>

Environment Variables

VariablePurpose
UV_COMPILE_BYTECODE=1Compile.pyc (faster startup)
UV_NO_SYNC=1Skip sync in uv run
UV_LINK_MODE=copyCopy files instead of hardlink
UV_MANAGED_PYTHON=1Only use uv-managed Python

Guidelines

Do

  • Use uv run instead of activating venv
  • Commit uv.lock for reproducible builds
  • Use --locked in CI/CD
  • Use --dev for test/lint dependencies
  • Use uvx for one-off tool usage

Don't

  • Activate venv manually (use uv run)
  • Forget to commit uv.lock
  • Mix pip and uv in same project
  • Skip --locked in production

Migration Cheatsheet

Old Tooluv Equivalent
pip install Xuv add X or uv pip install X
pip install -r requirements.txtuv add -r requirements.txt
python script.pyuv run script.py
pipx run ruffuvx ruff
pipx install ruffuv tool install ruff
pyenv install 3.12uv python install 3.12
poetry add Xuv add X
poetry installuv sync
poetry lockuv lock

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.51%
按下载量换算25

Claude

30.99%
按下载量换算22

Cursor

20.52%
按下载量换算15

Gemini CLI

10.87%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills