setup-python
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
More from meriley/claude-code-skills
vendure-developing
Develop Vendure e-commerce plugins, extend GraphQL APIs, create Admin UI components, and define database entities. Use vendure-expert agent for comprehensive guidance across all Vendure development domains.
36vendure-admin-ui-writing
Create Vendure Admin UI extensions with React components, route registration, navigation menus, and GraphQL integration. Handles useQuery, useMutation, useInjector patterns. Use when building Admin UI features for Vendure plugins.
33vendure-entity-writing
Define Vendure database entities extending VendureEntity, with TypeORM decorators, relations, custom fields, and channel-awareness. Use when creating database models in Vendure.
31vendure-plugin-writing
Create production-ready Vendure plugins with @VendurePlugin decorator, NestJS dependency injection, lifecycle hooks, and configuration patterns. Use when developing new Vendure plugins or extending existing ones.
29vendure-admin-ui-reviewing
Review Vendure Admin UI extensions for React pattern violations, missing hooks, improper state management, and UI anti-patterns. Use when reviewing Admin UI PRs or auditing UI quality.
26vendure-graphql-reviewing
Review Vendure GraphQL resolvers for missing RequestContext, improper permissions, DTO violations, and schema extension issues. Use when reviewing GraphQL PRs or auditing API quality.
21