$30 off During Our Annual Pro Sale. View Details »

Twisted History of Python Packaging

Mahdi Yusuf
November 07, 2012

Twisted History of Python Packaging

Python Packaging has had a more than less than ideal evolution. This talk aims to clarify this evolution so we can build a better future.

Mahdi Yusuf

November 07, 2012
Tweet

More Decks by Mahdi Yusuf

Other Decks in Programming

Transcript

  1. Twisted history of Python Packaging

  2. Mahdi Yusuf @myusuf3 Pycoder’s Weekly

  3. FOCUS UP. This journey is a story of growth which

    is often extremely convoluted.
  4. setup.py developers pypi metadata end user

  5. None
  6. import os import sys try: from setuptools import setup except

    ImportError: from distutils.core import setup sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) from octogit import __version__ def publish(): os.system("python setup.py sdist upload") if sys.argv[-1] == "publish": publish() sys.exit() dependencies = ['clint2','requests'] setup( name='octogit', version=".".join(str(x) for x in __version__), description='giving git tentacles to work better with github', url='https://github.com/myusuf3/octogit', author='Mahdi Yusuf', author_email='yusuf.mahdi@gmail.com', install_requires=dependencies, tests_require=['tox==1.3'], packages=['octogit', ], license='MIT License', long_description=open('README.rst').read(), entry_points={ 'console_scripts': [ 'octogit = octogit.cli:begin', ], }, classifiers=( 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Natural Language :: English', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ))
  7. distribute distutils2 setuptools distutils

  8. distutils from distutils.core import setup setup(name='sadness', version='11.0', py_modules=['sadistic.py']) $ python

    setup.py sdist $ python setup.py install
  9. distutils No dependency management.

  10. distutils No consistent way to reproduce an installation.

  11. distutils Not all metadata is handled.

  12. distribute distutils2 setuptools distutils

  13. setuptools built on distutils.

  14. setuptools no way to uninstall installed packages.

  15. setuptools provides dependency management.

  16. setuptools introduces easy_install.

  17. setuptools eggs.

  18. setuptools misunderstood.

  19. distribute distutils2 setuptools distutils

  20. distribute fork of setuptools.

  21. distribute distutils2 setuptools distutils

  22. versioning. distutils2

  23. 1.1 “Return of the Mac” Musky Monkey demo5.unreleased 5 6

    42 Public API Changes Features, Deprecations Bug Fixes
  24. setup.cfg distutils2

  25. distutils2 [metadata] name = sadness version = 11.0 author =

    Mahdi Yusuf author-email = mahdi@sadness.co.uk summary = sending you sadness description-file = README.rst project-url: http://www.twitter.com/myusuf3 [files] packages = sadness extra_files = setup.py README resources = etc/pytz.timezones
  26. distutils2 pysetup.

  27. defined requirements based on environment. distutils2

  28. discontinued? distutils2

  29. Attack of the PEPS

  30. PEP 386 -- Changing the version comparison modules PEP 376

    -- Database of Installed Python Distributions PEP 345 -- Metadata for Python Software Packages 1.2
  31. setuptools easy_install distribute pip old busted new hawtness

  32. fin. twitter.com/myusuf3