Cookiecutter template for a Python package.
- GitHub repo: https://github.com/ZordoC/cookiecutter-simple-pypackage/
- Documentation: https://cookiecutter-pypackage.readthedocs.io/
- Free software: BSD license
- Testing setup with
pytest
. - Formatting (black, docformatter, isort).
- Linting (flake8, pylint).
- Pre-commit configured.
- Sphinx_ docs: Documentation ready for generation with, for example, `Read the Docs`_
Install the latest Cookiecutter if you haven't installed it yet (this requires Cookiecutter 1.4.0 or higher):
pip install -U cookiecutter
Generate a Python package project:
cookiecutter https://github.com/ZordoC/cookiecutter-simple-pypackage/
cd <package-name>;
python -m venv .venv
. .venv/bin/activate
make venv-dev
git init
pre-commit install
git add .
git commit -m "First commit"
There's a development Dockerfile stored in docker/, highly recommend having distinct Dockerfiles for different enviroments. You need to have remote-container VScode extension installed, once you have that:
- Open folder with VScode.
- Open Pallet CMD + SHIFT + P (MacOS).
- Select Remote-Containers: Reopen in container.
- git init; pre-commit install; git add . ; git commit -m "Stuff"
make tests
make format
make lint
Pre-built documentation setup!
make docs
You can distribute via wheel file (https://www.reddit.com/r/learnpython/comments/78xtap/eli5_python_wheels/).
make dist
For more details, see the cookiecutter-pypackage tutorial.