Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Pipenv: Python Dev Workflow for Humans

65 views

Published on

Pipenv is a tool that aims to bring the best of packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the Python world. At Niteo we’ve migrated a few projects away from zc.buildout to pipenv and the results are good. In this talk, I’ll share the goods and the bads of the transition.

http://pipenv.readthedocs.io/en/latest/ is now the officially recommended Python packaging tool from Python.org. But it’s strongly opinionated and it can bite you if you don’t know what to expect. I learned the hard way.

What I am trying to say is, since it’s now the officially recommended Python packaging tool, Pythonistas need to educate themselves about it. What it is, how to use it and what to be careful about. I’ve used pipenv in production since last year and I have a few battle stories to tell.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Pipenv: Python Dev Workflow for Humans

  1. 1. PIPENV Python Dev Workflow for Humans
  2. 2. QUESTIONS? Shoot!
  3. 3. A QUICK TASTE OF PIPENV
  4. 4. “Pipenv is the porcelain I always wanted to build for pip. It fits my brain and mostly replaces virtualenvwrapper and manual pip calls for me. Use it. -Jannis Leidel, former pip maintainer
  5. 5. “This package manager is really awesome. For the first time I know exactly what my dependencies are which I installed and what the transitive dependencies are. Combined with the fact that installs are deterministic, makes this package manager first class, like cargo. -David Gang
  6. 6. BUT WHY? pip is just fine …
  7. 7. CONVENIENCE ➤ No need to use pip and virtualenv separately. ➤ They work together.
  8. 8. RESILIENCE ➤ Managing requirements is hard and burn-inducing. ➤ Pipfile vs Pipfile.lock ➤ abstract dependencies vs KGS ➤ actual vs transitive deps
  9. 9. amqp==2.3.2 anyjson==0.3.3 billiard==3.5.0.3 celery==4.0.0 kombu==4.2.1 python-dateutil==1.5 pytz==2018.4 vine==1.1.4 pip
  10. 10. amqp==2.3.2 anyjson==0.3.3 billiard==3.5.0.3 celery==4.0.0 kombu==4.2.1 python-dateutil==1.5 pytz==2018.4 vine==1.1.4 pip amqp==2.3.2 billiard==3.5.0.3 celery==4.0 kombu==4.2.1 pytz==2018.4 vine==1.1.4 pipenv
  11. 11. amqp==2.3.2 anyjson==0.3.3 billiard==3.5.0.3 celery==4.0.0 kombu==4.2.1 python-dateutil==1.5 pytz==2018.4 vine==1.1.4 pip amqp==2.3.2 billiard==3.5.0.3 celery==4.0 kombu==4.2.1 pytz==2018.4 vine==1.1.4 pipenv
  12. 12. SECURITY ➤ Hashes. Everywhere. ➤ Automatic vuln. discovery. ➤ Always up-to-date.
  13. 13. SECURITY ➤ Hashes. Everywhere. ➤ Automatic vuln. discovery. ➤ Always up-to-date.
  14. 14. SECURITY ➤ Hashes. Everywhere. ➤ Automatic vuln. discovery. ➤ Always up-to-date.
  15. 15. hupper==1.3 pastedeploy==1.5.2 plaster-pastedeploy==0.5 plaster==1.0 pyramid==1.9.2 repoze.lru==0.7 translationstring==1.3 venusian==1.1.0 webob==1.8.2 zope.deprecation==4.3.0 zope.interface==4.5.0 A couple months back hupper==1.0 pastedeploy==1.5.2 plaster-pastedeploy==0.4.2 plaster==1.0 pyramid==1.9.1 repoze.lru==0.7 translationstring==1.3 venusian==1.1.0 webob==1.7.3 zope.deprecation==4.2.0 zope.interface==4.4.2 Today
  16. 16. MORE COOKIES ➤ pipenv shell ➤ pipenv graph ➤ --three or --two ➤ --unused ➤ --rm ➤ --system ➤ --deploy ➤ --keep-outdated

  17. 17. MORE COOKIES ➤ pipenv shell ➤ pipenv graph ➤ --three or --two ➤ --unused ➤ --rm ➤ --system ➤ --deploy ➤ --keep-outdated

  18. 18. PIPENV DRAWBACKS ➤ Only dev and production mode ➤ No offline mode ➤ Not very fast ➤ Not very stable
  19. 19. PIPENV DRAWBACKS ➤ Only dev and production mode ➤ No offline mode ➤ Not very fast ➤ Not very stable
  20. 20. PIPENV DRAWBACKS ➤ Only dev and production mode ➤ No offline mode ➤ Not very fast ➤ Not very stable
  21. 21. PIPENV: RECAP ➤ Truly deterministic builds ➤ Verifies hashes ➤ Checks for security issues ➤ Keeps you up-to-date ➤ requests-level of convenience
  22. 22. @nzupan NITEO.CO/CAREERS

×