How Little Snakes are Made

Modern Python Dependency Management in 2018 using pipenv

Little Snakes?

"If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton"

3rd party libraries are used in almost every project.

Managing these dependencies has a long and varied history.

Sometimes it feels like this...

A Brief History of the World

  • Distutils (2000, Python 1.6 / 2.0)
  • PyPI (2003, Python 2.3)
  • Setuptools / easy_install (2004)
  • Virtualenv (2007, Python 2.5)
  • Pip (2008, Python 2.6/3.0)
  • Virtualenvwrapper (2010)
  • Pew (2013)
  • Wheels (2013)

So what?

Pipenv pulls all of this together

  • Virtualenv management
  • Dependency installation
  • Canonical notation
  • Reasonable upgrade process

Why should I use it?

  • Reproducible builds
  • Simplifies sharing projects with other developers
  • Conflicting version mitigation

Basic usage

<Do live coding, pray it works>

  • pipenv install
  • pipenv run

Pipfile, Pipfile.lock

Pipfile is for me, Pipfile.lock is for you.

Pipfile lists just the packages and versions you asked pipenv to install directly (the canonical dependencies).

Pipfile.lock lists the packages that were actually installed (including their dependencies and exact versions).

Migrating from requirements.txt

Undoing things

  • Remove individual packages:
    pipenv uninstall
  • Remove virtualenv:
    pipenv --rm

Thank You

http://pipenv.vitale.io (presentation) http://pipenv.readthedocs.io/en/latest/ (Pipenv Docs)