Workbench python template: a tagline that sounds hip and cool and convinces you
This is a poetry package template used for creating python packages using modern development tools.
This package template was adapted from the py-pkgs cookiecutter template by Thomas Beuzen.
Features
This template uses the following tools for development, code quality & testing:
Poetry
(obviously)Pre-commit
to run static checks on codeBlack
for code formattingIsort
for sorting dependenciesCodespell
for correcting spellingRuff
for lintingPyproject-fmt
to format pyproject.tomlInterrogate
for docstring coverageDeptry
to check for possible package conflictsMypy
for type hint checkingNox
&nox-poetry
for testing across python versionsInvoke
for defining re-usable / useful commandsPython-semantic-release
for versioning based on git commitssync_with_poetry
pre-commit hook to keep parity between dev package versions and pre-commit revs.
Additionally, this package template contains starter code using:
typer
for creating CLIspydantic_yaml
for creating/parsing YAML config files
Recipes
Depending on how you want to use the template, you can find additional setup in the recipes subsection of the docs.
Usage
Please see the documentation for more detail on using workbench-package-template
. We provide the fundamental steps below:
-
Install
cookiecutter
: -
Generate a Python package structure using
workbench-package-template
:
First steps
-
Create a GH repository and do the following:
-
Enable GH pages by going to Settings > Pages and selecting Source as 'GitHub actions', then selecting 'Static HTML'. Cancel the action that is created for you (this is already incorporated in the template).
-
Run
poetry install
-
Check in the changes and push to main with the commit message 'ci skip'
-
Run
poetry shell
-
Run
invoke set-up-pre-commit
to set up the pre-commit hooks
Contributing
Interested in contributing? Check out the Contributing Guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
License
py-pkgs-cookiecutter
was created by Tomas Beuzen and Tiffany Timbers. It is licensed under the terms of the BSD license.
Acknowledgements
py-pkgs-cookiecutter
was originally developed for use in the University of British Columbia's (UBC) Master of Data Science
_ program (MDS). It was inspired by the pyOpenSci cookiecutter
template.