This cookiecutter is deprecated, it has evolved to https://github.com/flowtaleai/copier-python-poetry/
My opinionated cookiecutter for python projects.
WARNING: it is still a work in progress.
| Task | Tool |
|---|---|
| Common style | EditorConfig |
| Pre-commit hooks | pre-commit |
| Autoformatter | black with experimental string processing (--preview) |
| Testing framework | pytest |
| Test mocking | pytest-mock |
| Version management | bump2version |
| Editor configuration | vscode with suggested extensions |
-
Create a new project based on this template
cookiecutter https://github.com/simgunz/cookiecutter-python
-
Commit all the files
git init git add . git commit -
Generate the poetry (or pipenv) lock file
poetry install
-
Commit the lock file
git add poetry.lock git commit
-
Install the commit hooks
poetry run pre-commit install
-
Open VSCode and install the suggested extensions
-
VSCode should automatically detect the virtual environment (otherwise use
Select python interpreter...to select the correct venv) -
To perform actions in the shell, explicitly activate the virtual environment
poetry shell