We Store Cheese in A Warehouse

We Store Cheese in A Warehouse

Context of this talk: https://speakerdeck.com/uranusjr/we-buy-cheese-in-a-cheese-shop

What Python Packaging went through in the past few years, how it is at year 2017, and looking ahead.

9dafad54b5b4f360b7aae5f482bc1c91?s=128

Tzu-ping Chung

September 21, 2017
Tweet

Transcript

  1. We Store Cheese in the Warehouse

  2. None
  3. None
  4. http://lucumr.pocoo.org/2012/6/22/hate-hate-hate-everywhere/

  5. 2012

  6. Party Like It’s 2012 • Setuptools • site and .pth

    files • Eggs
  7. Setuptools • Package metadata • Dependency resolution! • easy_install

  8. LIAR!!!1

  9. None
  10. .pth • Path configuration file • Placed in site-packages •

    Populate sys.path at runtime
  11. A PIL Tutorial >>> import Image >>> im = Image.open("louie.jpg")

    >>> im.show() https://gist.github.com/bradmontgomery/3125124 ?
  12. $ ls $LIB/python2.7/site-packages PIL pkg_resources PIL.pth setuptools easy_install.py setuptools-36.5.0.dist-info easy_install.pyc

    wheel pip wheel-0.30.0.dist-info pip-9.0.1.dist-info
  13. >>> import Image >>> print(Image.__file__) lib/python2.7/site-packages/PIL/Image.pyc >>> import sys >>>

    for path in sys.path: ... print path ... (more...) lib/python2.7/site-packages/PIL (more...)
  14. $ ls $LIB/python2.7/site-packages PIL pkg_resources PIL.pth setuptools easy_install.py setuptools-36.5.0.dist-info easy_install.pyc

    wheel pip wheel-0.30.0.dist-info pip-9.0.1.dist-info This
  15. PTH FILES PTH FILES EVERYWHERE

  16. 2014

  17. None
  18. None
  19. None
  20. None
  21. None
  22. Now

  23. PyPA’s Schedule • Merge back Distribute • New binary format

    (wheel) • Built-in Setuptools and Pip • Better Security
  24. None
  25. None
  26. HTTPS support on PyPI

  27. https://packaging.python.org

  28. Next

  29. Package Author Server User

  30. https://pypi.org

  31. https://github.com/pypa/warehouse

  32. Package Author Server User

  33. https://pipenv.org

  34. Pipfile • “Requirements 2.0” • Eventual pip -p integration •

    https://github.com/pypa/pipfile
  35. Pipfile • The “lock” concept • PEP 508 environment markers

    • Robust file format
  36. Package Author Server User

  37. SETUP.PY INSTALL MUST DIE

  38. None
  39. setup.py • Ad-hoc executable is always wrong • Don’t know

    what will happen until they actually happen • Wrong assumptions on top of wrong assumptions
  40. https://en.wikipedia.org/wiki/Catch-22_(logic)

  41. pyproject.toml • Declarative data file • PEP 508 for requirement

    specification • Eventual support in Pip
  42. Summary • Use Pipenv to manage projects • Use modern

    tools to distribute packages • Adopt PEP 508, prepare for PEP 518
  43. Summary • A lot can happen in five years •

    PyPA rocks, please help them • Looking forward to the next five!
  44. None