setup-python
1
总安装量
1
周安装量
#48257
全站排名
安装命令
npx skills add https://github.com/meriley/claude-code-skills --skill setup-python
Agent 安装分布
amp
1
opencode
1
kimi-cli
1
codex
1
github-copilot
1
claude-code
1
Skill 文档
Python Development Setup Skill
Purpose
Quickly set up and verify a Python development environment using UV for fast, reliable dependency management.
CRITICAL: Always Use UV
NEVER use pip directly. ALWAYS use UV for Python dependency management.
UV is 10-100x faster than pip and provides:
- Deterministic dependency resolution
- Lockfile support
- Virtual environment management
- Drop-in pip replacement
Workflow
Quick Setup Checklist
- â Verify Python 3.10+
- â Install UV (required package manager)
- â Setup virtual environment with UV
- â Install dependencies
- â Setup Ruff (linting + formatting)
- â Setup MyPy (type checking)
- â Setup pytest (testing)
- â Setup pre-commit hooks
- â Verify imports and dependencies
- â Run quality checks
- â Run tests
- â Verify environment reproducibility
For detailed step-by-step instructions with UV commands and troubleshooting, see references/DETAILED-WORKFLOW.md.
Troubleshooting
Issue: “uv: command not found”
Solution: UV not installed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Then restart shell or source profile
Issue: “No Python found”
Solution: Install Python with UV
uv python install 3.12
Issue: “Resolution failed”
Solution: Dependency conflict
# Show what's conflicting
uv pip install --dry-run -r requirements.txt
# Try with looser constraints
uv pip install --resolution=lowest .
Issue: “ModuleNotFoundError: No module named ‘X'”
Solution: Dependency not installed
uv pip install -e ".[dev]"
# or
uv pip install <module-name>
Best Practices
- Always use UV – Never use pip directly
- Use pyproject.toml – Modern Python standard
- Use Ruff – Replaces flake8, black, isort (faster)
- Lock dependencies – Use
uv lockoruv pip compile - Pin Python version – Use
uv python pin - Enable mypy strict mode – Catch type errors early
- Use pre-commit hooks – Automate checks
- Target 90%+ coverage – Comprehensive testing
Migration from pip
If you have an existing project using pip:
# Create new venv with UV
rm -rf venv .venv
uv venv
# Activate
source .venv/bin/activate
# Install existing requirements
uv pip install -r requirements.txt
# Generate lock file
uv pip compile requirements.txt -o requirements.lock
Integration with Other Skills
This skill may be invoked by:
quality-check– When checking Python code qualityrun-tests– When running Python tests