Modern Python project template with Poetry, Makefile workflows, automated testing, linting, and GitHub Actions CI/CD.
All notable changes to this project will be documented in CHANGELOG.
Supports Python 3.12, 3.13
- Poetry - Modern dependency management
- Makefile - Convenient command shortcuts for common tasks
- pytest - Testing framework with coverage reporting
- black - Code formatting
- flake8 - Python code linting
- yamllint - YAML file linting
- CodeQL - Automated security analysis (workflow)
- Secrets Scan - Gitleaks and TruffleHog for detecting hardcoded secrets (workflow)
- Snyk - Vulnerability scanning (workflow)
- Dependabot - Automated dependency updates (config)
- GitHub Actions - Automated testing and deployment
- Codecov - Code coverage reporting
- Stale Issue Management - Automatically closes inactive issues
Click "Use this template" on GitHub or:
mkdir new_repo_name
cd new_repo_name
git init
git pull https://github.com/kyhau/python-repo-templateUpdate these files:
pyproject.toml- Package name, version, dependenciesMakefile- SetPACKAGE_NAMEandTEST_PATHvariablesREADME.md- Replace with your project descriptionapp/- Rename to your package name
Quick setup (recommended for first-time setup):
make setup-initManual setup (if you prefer step-by-step):
make setup-venv # Configure Poetry to use local virtualenv
make install-all # Install all dependenciesmake setup-init # First-time setup (configure, lock, install everything)
make help # Show all available commands
make install-all # Install all dependencies (main, dev, test)
make test # Run tests without coverage
make test-with-coverage # Run tests with coverage
make format-python # Auto-format Python code
make lint-python # Lint Python code
make lint-yaml # Lint YAML files
make pre-commit # Run all quality checks (format, lint, test)
make build # Build the package
make clean # Clean build artifacts# Run tests with coverage
make test-with-coverage
# Run tests only
make test
# Format and lint code
make format-python
make lint-python
make lint-yaml# Update dependencies to latest compatible versions
make update-deps
# Regenerate lock file
make lockpython-repo-template/
βββ .github/
β βββ workflows/ # CI/CD workflows
β βββ dependabot.yml # Dependency updates config
βββ app/ # Your Python package
β βββ __init__.py
β βββ main.py
βββ tests/ # Unit tests
β βββ test_main.py
βββ pyproject.toml # Project metadata and dependencies
βββ Makefile # Build and test commands
βββ README.md # This file
# Build the package
make build
# The built package will be in dist/
ls dist/