Personal tools
You are here: Home Documentation Tutorials Introduction to zc.buildout Working with eggs

Working with eggs

Python eggs and how zc.buildout gives you better control over using eggs
Jim Fulton's tutorial for using buildout, originally given at DZUG 2007
Page 2 of 17.
  • Eggs rock!
  • easy_install
    • Easy!
    • Installs into system Python
    • Not much control
  • workingenv makes easy_install much more usable
    • Avoids installing into system Python
    • Avoids conflicts with packages installed in site_packages
    • Really nice for experimentation
    • Easy!
    • Not much control

zc.buildout and eggs

  • Control

    • Configuration driven

      • easier to control versions used

      • always look for most recent versions by default

        handout

        When upgrading a distribution, easy_install doesn't upgrade dependencies,

      • support for custom build options

  • Greater emphasis on develop eggs

    • Automates install/uninstall
    • preference to develop eggs
    handout

    I often switch between develop and non-develop eggs. I may be using a regular egg and realize I need to fix it. I checkout the egg's project into my buildout and tell buildout to treat it as a develop egg. It creates the egg link in develop eggs and will load the develop egg in preference to the non-develop egg.

    (easy_install gives preference to released eggs of the same version.)

    When I'm done making my change, I make a new egg release and tell buildout to stop using a develop egg.

handout
zc.buildout is built on setuptools and easy_install.

zc.buildout current status

  • Actively used for development and deployment

  • Third-generation of ZC buildout tools

    handout

    Our earliest buildouts used make. These were difficult to maintain and reuse.

    Two years ago, we created a prototype Python-based buildout system.

    zc.buildout is a non-prototype system that reflects experience using the prototype.

  • A number of "recipes" available

A Python Egg Primer

Eggs are simple!

  • directories to be added to path

    • may be zipped
    • "zero" installation
  • Meta data

    • dependencies
    • entry points
  • May be distributed as source distributions

    handout

    easy_install and zc.buildout can install source distributions as easily as installing eggs. I've found that source distributions are more convenient to distribute in a lot of ways.

  • Automatic discovery through PyPI