‹ 首页

using-uv

@lexler · 收录于 昨天 · 上游提交 1 周前

Python package and project management with UV. Use when creating Python scripts, initializing projects, or managing dependencies.

适合你,如果需要高效管理 Python 项目依赖。

/ 通过 npx 安装 校验哈希
npx oh-my-skill add lexler/skill-factory/using-uv
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- lexler/skill-factory/using-uv
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify lexler/skill-factory/using-uv
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
223GitHub stars
~306最小装载
~1.6K含声明引用
~1.6K文本包总量
索引托管

怎么用

商店整理自技能原文 · 版本 2eae60e · 表述以原文为准
它做什么

安装后,Claude 会使用 UV 工具来管理 Python 脚本和项目,包括初始化项目、添加依赖、运行脚本等操作。

什么时候触发

当你需要创建 Python 脚本、初始化项目或管理依赖时触发。

装好后可以这样说
执行 uv init myapp 命令
执行 uv run script.py 命令
技能原文 SKILL.md作者撰写 · Apache-2.0 · 2eae60e

UV

UV is a fast Python package manager. Two modes:

Scripts vs Projects

Use scripts when:

  • Single .py file
  • Quick utility, one-off task
  • No shared dependencies across files

Use projects when:

  • Multiple files, modules, or packages
  • Team collaboration
  • Need reproducible environments
  • Building a library or application
Scripts

Standalone Python files with inline dependencies (PEP 723).

#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = ["requests", "rich"]
# ///

import requests
from rich import print

Run: uv run script.py

See [references/scripts.md](references/scripts.md) for full guide.

Projects

Structured Python with pyproject.toml and lockfile.

uv init myproject
cd myproject
uv add requests
uv run python main.py

Key files:

  • pyproject.toml - metadata and dependencies
  • uv.lock - exact versions for reproducibility
  • .python-version - Python version

See [references/projects.md](references/projects.md) for full guide.

Common Patterns
uv run pytest                     # Run in project env
uv add --dev pytest               # Dev dependency
uvx ruff check .                  # One-off tool execution
uv run --with rich script.py      # Script with ad-hoc dep
按 Apache-2.0 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。