Best practices cookiecutter template as described in this blogpost.
- Testing with pytest
- Formatting with black
- Import sorting with isort
- Static typing with mypy
- Linting with flake8
- Git hooks that run all the above with pre-commit
- Deployment ready with Docker
- Continuous Integration with GitHub Actions
# Install cookiecutter
pip install cookiecutter
# Install venv
pip install virtualenv
# Use cookiecutter to create project from this template
cookiecutter gh:ds4data/python-best-practices-cookiecutter
# Enter project directory
cd <repo_name>
# Initialise git repo
git init
# Create a virtualenv and activate it
python -m venv .env
./.env/Scripts/activate
# Install dependencies
pip install -r requirements.txt
# Setup pre-commit and pre-push hooks
pre-commit install -t pre-commit
pre-commit install -t pre-push