• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
We Buy Cheese in a Cheese Shop

We Buy Cheese in a Cheese Shop



NOTE: SlideShare seems to have problems rendering some of my screenshots. Please visit ...

NOTE: SlideShare seems to have problems rendering some of my screenshots. Please visit


for a correctly-displayed version.

Python packaging is ______. But PyPA is trying to solve the problem. Let's take a look at how we got into this mess in the first place, and how did/will PyPA do to fix it.



Total Views
Views on SlideShare
Embed Views



1 Embed 1

http://www.linkedin.com 1



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    We Buy Cheese in a Cheese Shop We Buy Cheese in a Cheese Shop Presentation Transcript

    • We Buy Cheese in a Cheese Shop
    • Cheese Shop
    • Cheese Shop Sketch http://en.wikipedia.org/wiki/Cheese_Shop_sketch
    • https://pypi.python.org/pypi
    • Click this!
    • “I buy my eggs at the cheese shop” ] E G A U G - Aaron Straup Cope N O O [M DjangoCon 2008 N A L 59 Why I Hate Django by Cal Henderson at DjangoCon 2008
    • Me • Call me TP • Follow @uranusjr • RTFM • http://uranusjr.logdown.com/pages/about
    • Terminology
    • PyPI
    • Python Package Index aka The Cheese Shop
    • PyPA
    • Python Packaging Authority Nobody Expects the Python Packaging Authority by Nick Coghlan at PyCon Australia 2013
    • The Spanish Inquisition http://en.wikipedia.org/wiki/The_Spanish_Inquisition_(Monty_Python)
    • Egg
    • Eggs are to Pythons as Jars are to Java http://peak.telecommunity.com/DevCenter/PythonEggs
    • Wheel
    • Wheels as in Cheese Shops
    • http://www.pythonwheels.com (retrieved on 2013-11-30)
    • http://www.python.org/dev/peps/pep-0427/
    • Wheel is… • The replacement of egg • Standardized • Alternative Python implementation • API tag • Packaged with better structure and metadata • Performance • Security
    • But Why? If It Ain’t Broke, Don’t Fix It
    • Because Eggs Are Broken No pun intended
    • Where We Are Now
    • Server Package Author You
    • Server Package Author You
    • distutils • I am no expert on neither itself nor its history • Built-in since Python 1.6 (2000) • Nothing really changed since about 10 years ago Full documentation: http://docs.python.org/library/distutils.html
    • Container What you want to deploy Full documentation: http://docs.python.org/library/distutils.html
    • The “Makefile” Full documentation: http://docs.python.org/library/distutils.html
    • Extra rules on non-module information Full documentation: http://docs.python.org/library/distutils.html
    • setup.py from distutils.core import setup! ! setup(! name='mypackage',! version='1.0',! packages=['mymodule'],! description='My package',! url='http://myawesomepackage.com',! author='Me the Author',! author_email='im@aweso.me'! ) Documentation: http://docs.python.org/distutils/setupscript.html
    • MANIFEST.in include README.rst! recursive-exclude * __pycache__! recursive-exclude * *.py[co]! include docs! prune docs/build Documentation: http://docs.python.org/distutils/sourcedist.html
    • $ python setup.py sdist! ! $ python setup.py bdist_wininst Documentation: http://docs.python.org/distutils/sourcedist.html
    • from setuptools import setup! ! setup(! # ...! ) $ python setup.py bdist_egg Documentation: http://peak.telecommunity.com/DevCenter/PythonEggs
    • Source distribution
    • Binary egg
    • Windows installer
    • “I buy my eggs at the cheese shop” - Aaron Straup Cope DjangoCon 2008 58 Does this make sense now?
    • Package metadata (collected from setup)
    • The “zip safety” flag
    • Top level modules
    • Files in the package
    • Depended packages
    • Package information (as seen on PyPI)
    • Where to find packages (aside from PyPI)
    • Server Package Author You
    • $ python setup.py register! ! $ python setup.py sdist bdist_egg upload Documentation: http://docs.python.org/distutils/packageindex.html
    • Server Package Author You
    • PyPI Package Author You
    • PyPI mirror mirror Package Author You
    • PyPI Package Author Self-hosted Server You
    • [Y]ou don't have to worry about it. They've figured it all out already. The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) by Joel Spolsky
    • Actually they did not; I just don’t want to talk about it.
    • Server Package Author You
    • The Manual Way 1. Go to PyPI and search for a package 2. Download 3. Install • Extract • python setup.py install
    • With Setuptools 1. Install Setuptools 2. Run easy_install <package>! 3. Profit! Documentation: https://pypi.python.org/pypi/setuptools#installation-instructions
    • Problem?
    • LIAR!!!1
    • What is zip-safe, anyway?
    • Why PIP? • All packages are downloaded before installation • Flat installation by default • Uninstallation • Clean code™ • PyPI with HTTPS by default http://www.pip-installer.org/en/latest/other-tools.html#easy-install
    • Why NOT PIP? • Incompatible with certain legacy packages (rare) • Cannot install from bdist packages (except eggs) http://www.pip-installer.org/en/latest/other-tools.html#easy-install
    • 先別說 個了! 你聽過 distribute ?
    • Commit history of https://bitbucket.org/pypa/setuptools/
    • https://bitbucket.org/tarek/distribute/overview
    • distribute • Intended to replace Setuptools • Shares the same module names (setuptools and pkg_resources) • Active development https://bitbucket.org/tarek/distribute/overview
    • http://xkcd.com/927/
    • We Need a New Standard!
    • http://ziade.org/2010/03/03/the-fate-of-distutils-pycon-summit-packaging-sprint-detailed-report/
    • http://www.python.org/dev/peps/pep-0376/
    • o N e v E t in n t y P n o h .4 3
    • This is what you get when developers fight with each other. Panel: Directions for Packaging, PyCON US 2013
    • ./setup.py install must die! Panel: Directions for Packaging, PyCON US 2013
    • PyPA’s Schedule • Merge Distribute back to Setuptools (Done) • New binary distribution format (Done) • Built-in Setuptools and pip support in Python • Better security • …And more! The Future of Python Packaging, Python Packaging User Guide
    • https://github.com/pypa/pip/commit/b90fc1a
    • pip >= 1.4 setuptools >= 0.8 Upgrading notes: http://pythonhosted.org/setuptools/merge-faq.html
    • $ python setup.py bdist_wheel upload $ pip install --use-wheel <package> Documentation: docs.python.org/distutils/packageindex.html
    • Name Python tag Platform Pillow-2.2.1-cp32-none-win32.whl Version ABI tag I’m a wheel!
    • Replaces dashes with underscores Platform independent django_mosql-0.2-py27-none-any.whl Implementation not relevant Does not need ABI information
    • Description gets its own file!
    • Other metadata (similar to PKG-INFO)
    • Unchanged
    • ???
    • Metadata in JSON
    • Wheel format specification
    • SHA256 for each file in this directory
    • What Changed? • The One True Cheese Shop • Forward compatibility • Machine-friendliness • Safety
    • Wrapping Up • Python packaging is _____ • How did we get into this mess? • distutils • setuptools • PyPI • A way out
    • Wheel is the future. Adapt today!