This repository serves as a template for developing Python applications using the uv package manager and potentially leveraging AI agents (like Cline) for development tasks. It comes pre-configured with Docker, Dev Containers, GitHub Actions CI, and common development tools.
- Modern Python Stack: Uses Python 3.13+ and
uv
for fast dependency management. - Containerized Development:
- Docker & Docker Compose: Provides consistent development and production environments using multi-stage builds (
dev
,prod
). - VSCode Dev Containers: Includes a
.devcontainer/devcontainer.json
configuration for a seamless development experience within VSCode.
- Docker & Docker Compose: Provides consistent development and production environments using multi-stage builds (
- Development Tools: Integrated with standard development tools:
- CI/CD: Includes GitHub Actions workflows (
.github/workflows/
) for automated linting and testing on code pushes. - (WIP) AI Agent Integration (Workflow Example):
- Designed to work with AI agents for planning and executing development tasks.
- Manages prompts and execution plans in Markdown format within the
docs/
directory.
Due to Dependabot not yet supporting PEP 735 [dependency-groups]
, this project uses [project.optional-dependencies]
instead. When adding dependencies, please note:
# Add to [project.dependencies]
uv add <package>
# Add to [project.optional-dependencies] dev group
uv add --optional dev <package>
# Install all dependencies including dev
uv sync --all-extras
# Or using pip-compatible command
uv pip install -e ".[dev]"
Once Dependabot supports [dependency-groups]
, we plan to migrate back to the more modern PEP 735 format.
.
├── .devcontainer/ # VSCode Dev Containers configuration
│ ├── compose.yml
│ └── devcontainer.json
├── .dockerignore
├── .editorconfig
├── .github/ # GitHub specific files
│ ├── dependabot.yml # Dependabot configuration
│ └── workflows/ # GitHub Actions CI workflows
│ ├── lint_docker.yml
│ ├── lint_gha.yml
│ ├── lint.yml
│ └── test.yml
├── .vscode/ # VSCode specific files
│ └── settings.json # VSCode settings
├── .gitignore
├── .python-version # Specifies Python version (primarily for uv/tooling)
├── Dockerfile # Defines container images (dev, prod, devcontainer)
├── compose.dev.yml # Docker Compose configuration for development
├── compose.yml # Docker Compose configuration for production
├── pyproject.toml # Project metadata and dependencies (PEP 621, uv, ruff, pyright, pytest, taskipy)
├── README.md # This file
├── uv.lock # Pinned versions of dependencies
├── docs/ # Documentation and AI agent related files
│ └── plans/ # Stores execution plans for development tasks (e.g., *.md)
│ ├── 20250414_update_python_version_plan.md # Example plan
│ └── 20250414_update_readme_plan.md # Example plan
├── htmlcov/ # HTML coverage reports (generated by pytest-cov)
└── src/ # Source code directory
├── __init__.py
├── main.py # Sample application code
└── tests/ # Test code directory
├── __init__.py
└── main_test.py # Tests for main.py
- Docker and Docker Compose
- VSCode with the "Dev Containers" extension (recommended)
- uv (if not using Docker)
- Open this repository in VSCode.
- When prompted ("Reopen in Container"), click it. VSCode will build the development container and connect to it automatically.
- You can now use the integrated terminal in VSCode, which runs inside the container.
- Build the development image:
docker compose -f compose.dev.yml build
- Run commands inside the container:
For example, to run tests:
docker compose -f compose.dev.yml run --rm app <command>
To get an interactive shell:docker compose -f compose.dev.yml run --rm app task test
docker compose -f compose.dev.yml run --rm app bash
- Install
uv
(if not already installed):# cf. https://github.com/astral-sh/uv?tab=readme-ov-file#installation curl -LsSf https://astral.sh/uv/install.sh | sh
- Install dependencies:
uv sync
- Run commands:
For example, to run tests:
uv run <command>
uv run task test
Run these tasks inside the development container (either via Dev Containers terminal or docker compose run
):
task lint
: Run linters (ruff check
andpyright
).task fix
: Automatically fix linting issues withruff
.task format
: Format code withruff format
.task test
: Run tests withpytest
.task test_cov
: Run tests and generate coverage reports.
Example:
# Inside Dev Container terminal or after `docker compose run ... bash`
task lint
task test_cov
(WIP)