Skip to content

danielphan-dp/minimal-python-boilerplate

Repository files navigation

Minimal Python Boilerplate

A minimal Python development environment with dev container support.

Features

  • Python 3.12
  • Git & GitHub CLI
  • uv (fast Python package manager)
  • Ruff (linting & formatting)
  • Pyright (type checking)
  • pytest (testing)
  • Dev container with VS Code integration

Getting Started

  1. Open this folder in VS Code
  2. Press Ctrl+Shift+P (or Cmd+Shift+P on Mac) and run Dev Containers: Reopen in Container
  3. Wait for the container to build and post-create script to complete
  4. Start developing!

Development Commands

Package Management with uv

# Install dev dependencies
uv sync --extra dev

# Add a new package
uv add <package-name>

# Add a dev dependency
uv add --dev <package-name>

# Remove a package
uv remove <package-name>

# Update dependencies
uv sync

Testing

# Run all tests
pytest

# Run with coverage
pytest --cov=src tests/

# Run specific test file
pytest tests/test_main.py

Code Quality

# Format code with ruff
ruff format .

# Lint code
ruff check .

# Fix auto-fixable issues
ruff check --fix .

# Type check with pyright
pyright

VS Code Commands

  • Ctrl+Shift+P - Command Palette
  • Ctrl+Shift+B - Run Build Task
  • F5 - Start Debugging
  • Python: Select Interpreter - Choose Python environment
  • Testing: Run All Tests - Execute test suite

Project Structure

.
├── .devcontainer/          # Dev container configuration
│   ├── devcontainer.json   # Container settings
│   └── post-create.sh      # Setup script
├── src/                    # Source code
│   ├── __init__.py
│   └── main.py
├── tests/                  # Test files
│   ├── __init__.py
│   └── test_main.py
├── pyproject.toml          # Project configuration
└── README.md

About

Minimal Python project boilerplate with tooling, testing, and conventional commits

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Contributors