Cookiecutter template for a Python package with Poetry.
Poetry is way faster and the eco system for packaing is way easier using Poetry.
- Testing setup with
unittest
andpython setup.py test
orpy.test
- Travis-CI: Ready for Travis Continuous Integration testing
- Tox testing: Setup to easily test for Python 2.7, 3.5, 3.6, 3.7
- Sphinx docs: Documentation ready for generation with, for example, ReadTheDocs
- Bumpversion: Pre-configured version bumping with a single command
- Auto-release to PyPI when you push a new tag to master (optional)
- Command line interface using Click (optional)
Install the latest Cookiecutter if you haven't installed it yet (this requires Cookiecutter 1.4.0 or higher):
pip install -U cookiecutter
Install the latest Poetry, [here](https://python-poetry.org/docs/)
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
or you can install it using pyenv:
cd ~ pyenv shell 3.10.4 pip3 install poetry==1.1.12 pyenv shell --unset
Generate a Python project that uses Pipenv:
cookiecutter gh:elgertam/cookiecutter-pipenv
Once your project has been created, change directories:
cd <project-name>
Then:
- Create a repo and put it there (e.g.
git init
). - Install the dev requirements into a virtualenv (
pipenv install --dev
). - Add the repo to your Travis-CI account.
- Register your project with PyPI.
- Run the Travis CLI command travis encrypt --add deploy.password to encrypt your PyPI password in Travis config and activate automated deployment on PyPI when you push a new tag to master branch.
- Add the repo to your ReadTheDocs account + turn on the ReadTheDocs service hook.
- Release your package by pushing a new tag to master.
- Activate your project on pyup.io.
This project itself is a fork of Audrey Roy Greenfeld's exceptional cookiecutter-pypackage. If you have differences in your preferred setup, I encourage you to fork this to create your own version. Or create your own; it doesn't strictly have to be a fork.
I will consider pull requests as they come in, if they enhance the overall packaging experience.