Skip to content

A cookiecutter for python packages, with docs and GitHub Actions CI

License

Notifications You must be signed in to change notification settings

executablebooks/python-pkg-cookiecutter

Repository files navigation

python-pkg-cookiecutter

Code style: black

A cookiecutter for creating python packages with all the mod-cons:

  • pre-commit checks with flake8 (linting) and black (formatting)
  • pytest setup
  • github actions for pre-commit, pytest and (optional) PyPi deployment
  • Sphinx docs builds
  • Circle CI for documentation testing
  • github issues templates

See tests/test_bake/test_bake_with_defaults.yml, for the list of created files.

Usage

$ pip install cookiecutter  # tested with cookiecutter==1.6
$ cookiecutter https://github.com/executablebooks/python-pkg-cookiecutter.git

Enter created folder then run tests:

$ pip install -e .[code_style,testing]
$ flake8 .
$ black .
$ pytest

To use pre-commit, the package must be in a git repository

$ git init
$ git add *
# to apply to staged files
$ pre-commit run
# restage if changes
$ git add *
# to run on commits
$ pre-commit install
$ git commit -m 'Initial commit'

Notes

PyPi deployment requires a PyPI API token to be added to the GitHub secrets (named PYPI_KEY). It is setup to deploy on tagged commits (if tests pass).

About

A cookiecutter for python packages, with docs and GitHub Actions CI

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published