A simply python template including black, isort, flake8, and mypy.
Search for <project-name> for spots where you need to substitue your own project name. You should also change the
author field in pyproject.toml.
It may also be useful to update tool versions in pyproject.toml and .pre-commit-config.yaml.
- Set up python:
- Install
pyenvandpyenv-virtualenv - Run
cat pyproject.tomlto find the desired python version. It will look likepython = "^<version>" - Run
pyenv versionsto see if a matching python version is installed. If not, runpyenv install <version>to install a matching version. - Run
pyenv virtualenv <version> <project-name>to create a new virtualenv for this project (versionmust be a fullvX.X.X, not just avX.X) - Run
pyenv local <project-name>to assign the virtualenv to this directory (by creating a.python-versionfile)
- Install
- Install dependencies:
- Set up pre-commit:
- Install
pre-commitusingpipx:pipx install pre-commit - Run
pre-commit installto activate pre-commit hooks for this repo
- Install
python main.py