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
pyenv
andpyenv-virtualenv
- Run
cat pyproject.toml
to find the desired python version. It will look likepython = "^<version>"
- Run
pyenv versions
to 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 (version
must 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-version
file)
- Install
- Install dependencies:
- Set up pre-commit:
- Install
pre-commit
usingpipx
:pipx install pre-commit
- Run
pre-commit install
to activate pre-commit hooks for this repo
- Install
python main.py