精选案例 · Agent / 实践案例
UV Real-World Examples
这个案例围绕「UV Real-World Examples」记录了一条真实 AI 实践线索,正文重点集中在「Overview」「Example Categories」,适合先按任务意图阅读再判断复用。
案例速读
README 标题「UV Real-World Examples」下已经出现运行/配置路径、脚本或接口线索,正文重点集中在「Overview」「Example Categories」,比纯概念介绍更适合进入精选阅读流。 这篇案例的阅读价值在于,它把真实任务、模型辅助过程和可迁移做法放在同一个上下文里,读者可以从 「UV Real-World Examples」、「Overview」、「Example Categories」、「[Inline Script Metadata](inline-scripts.md)」 进入正文。
- 建议重点看 可参考其中的运行与配置路径、包含可迁移的命令、脚本或接口线索、继续补充结果证据后推荐度会更高。结合 Agent / 实践案例 和「任务驱动用户、AI 实践者」这一受众定位,它更适合作为任务检索后的精读材料,而不是只看一句短摘要后快速跳过。
- 正文目录和原始材料仍然是判断依据;导读只帮助你更快定位阅读重点。
- 看点
- UV Real-World Examples
- 读者
- 任务驱动用户、AI 实践者
- 复用
- 可参考其中的运行与配置路径
- 结构
- 12 个目录入口
原文内容
UV Real-World Examples
Overview
This directory contains real-world examples, common patterns, and anti-patterns for UV usage across different scenarios.
Example Categories
Inline Script Metadata
PEP 723 inline script metadata examples with UV. Learn how to create self-contained Python scripts with embedded dependencies.
Topics:
- Basic inline dependencies
- Python version requirements
- MCP server with inline dependencies
- Data processing scripts
- When to use inline metadata
MCP Server Examples
Complete MCP server configuration examples for various platforms and use cases.
Topics:
- Published MCP servers (official, AWS, etc.)
- VS Code and Continue IDE configurations
- Local development setup
- Multi-configuration development
Development Workflows
Complete development tool setup and daily workflow patterns.
Topics:
- Python development environment setup
- Project-specific script execution
- Multi-version testing workflows
Virtual Environment Workflows
Virtual environment management patterns and best practices.
Topics:
- Basic project setup
- Existing project migration
- Multi-environment projects
CI/CD Examples
Continuous integration and deployment configurations.
Topics:
- GitHub Actions workflows
- GitLab CI pipelines
Migration Examples
Migration guides from other Python tools to UV.
Topics:
- From pip to UV
- From pipx to UV tool
- From poetry to UV
Common Patterns
Frequently used patterns and configurations.
Topics:
- Development tool suite setup
- Pre-commit integration
- Shell configuration
Anti-Patterns
Common mistakes to avoid when using UV.
Topics:
- Global pip installs
- Installing MCP servers with uv tool
- Using uvx for daily tools
- Mixed tool management
- Forgetting virtual environments
Complete Workflow
End-to-end example of setting up a new Python project with UV.
Topics:
- Full project initialization
- Git setup
- Dependency management
- Testing and formatting
- Documentation
How to Use These Examples
- Browse by topic - Use the category links above to find relevant examples
- Copy and adapt - All examples are designed to be copied and modified for your needs
- Follow patterns - Use the “DO” examples and avoid the “DON’T” anti-patterns
- Refer to related docs - Each example file links to relevant reference documentation