Skip to content

elgertam/cookiecutter-pipenv

Repository files navigation

Cookiecutter Python Package Template with Pipenv

travis donate

Cookiecutter template for a Python package with Pipenv.

Why Pipenv?

Packaging in Python can be a pain, but it doesn't need to be. The new Pipenv project has rapidly improved packaging in Python by tackling two related problems: automatic package dependency management and virtualenv management. Pipenv uses the new Pipfile format that is the endorsed replacement for requirements.txt. Pipenv is the future of Python package management, and is even recommended to newcomers in the Python tutorial.

Features

  • Testing setup with unittest and python setup.py test or py.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)

Quickstart

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 Pipenv:

pip install -U pipenv

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.

Fork This / Create Your Own

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.

Or Submit a Pull Request

I will consider pull requests as they come in, if they enhance the overall packaging experience.