This repository is a base template for Python projects with a containerized development workflow. It provides a structured scaffold for Python applications, including Docker and VS Code Dev Container configuration for easy setup.
- Python 3.11+ support with automatic multi-version CI testing
- Dockerized development with
Dockerfileanddocker-compose.yml - uv for fast dependency management
- Linting with ruff and type checking with mypy
- Unit testing setup with pytest
- GitHub Actions CI with automatic Python version discovery (currently tests 3.11, 3.12, 3.13, 3.14)
- Docker (and Docker Compose)
- VS Code with Remote - Containers extension
# Clone the repo
git clone https://github.com/yogaxpto/base-python-project.git
cd base-python-project
- Open the project in VS Code.
- Reopen in container when prompted.
- Start coding!
.
├── base_python_project/ # Main Python package
├── tests/ # Pytest test suite
├── .devcontainer/ # VS Code DevContainer setup
├── .github/workflows/ # GitHub Actions workflows
├── Dockerfile # Docker image definition
├── docker-compose.yml # Optional compose setup
├── pyproject.toml # Python dependencies and config
├── uv.lock # Lockfile from uv
├── ruff.toml # Ruff linter config
├── .gitignore
├── README.md
└── LICENSEpython -m base_python_projectpytestruff check .This project uses GitHub Actions for automated testing across multiple Python versions. The CI pipeline:
- Automatically discovers Python versions from
pyproject.toml(requires-pythonfield) - Tests on all stable Python versions from the minimum onward
- Runs quality checks (ruff, mypy) on the latest Python version
- Runs tests (pytest with coverage) on all discovered Python versions
The workflow uses snok/latest-python-versions for dynamic version discovery, ensuring zero maintenance for version management.
Two workflows are available:
- Python Matrix Tests (
.github/workflows/python-matrix-test.yml) - Multi-version testing with automatic discovery - Test (
.github/workflows/python-test.yml) - Docker-based single-version testing
- Fork the repo & create a new branch.
- Write and test your changes.
- Ensure
ruffandpytestpass. - Submit a Pull Request.
This project is licensed under the MIT License.