Differences between revisions 3 and 4
Revision 3 as of 2008-03-11 19:52:09
Size: 815
Editor: JeffRush
Comment:
Revision 4 as of 2008-03-11 20:54:07
Size: 2238
Editor: JeffRush
Comment:
Deletions are marked like this. Additions are marked like this.
Line 40: Line 40:
  3. ???   3. Processing Distributions

     1. Grab a source distribution

        | $ /sandbox/bin/easy_install --editable --build-directory . SQLObject==0.9.5
        | $ /sandbox/bin/easy_install --editable --build-directory . SQLObject==dev

        Examine its directory structure and common files.

     2. Query the list of available distribution formats.

        | $ cd sqlobject
        | $ /sandbox/bin/python setup.py sdist --help-formats
        | $ /sandbox/bin/python setup.py bdist --help-formats

     3. Build and package it as a binary distribution.

        | $ /sandbox/bin/python setup.py build
        | $ /sandbox/bin/python setup.py install
        | $ /sandbox/bin/python setup.py bdist --formats=tar,egg,rpm

        Examine the run output and the table-of-contents of the distribution
        archive afterward. Note the way that metadata is stored.

     4. Repackage it as a source distribution

        | $ /sandbox/bin/python setup.py sdist --formats=zip

        Examine the run output and the table-of-contents of the source
        archive. Note the different way that metadata is stored.

     5. Try to import it, then run the "develop" cmd and try again.

        | $ cd /sandbox
        | $ /sandbox/bin/python
        | $ import sqlobject

        ..

        | $ cd /sandbox/sqlobject
        | $ /sandbox/bin/python setup.py develop

  4. ???

Eggs and Buildout Deployment in Python

Slides:

  • Virtualenv
  • Distutils
  • Setuptools
  • Buildout

Exercises:

  1. Installing Tools for the Class

    $ cd /tmp
    $ sudo python ez_setup.py
    $ sudo easy_install virtualenv
    $ sudo easy_install zc.buildout
  2. Instantiating a Sandbox or Two

    $ virtualenv pycon -or-
    $ virtualenv --no-site-packages pycon
    $ cd pycon
    $ bin/python
    $ source bin/activate -or- activate.bat
    $ deactivate
    • explore:
      • directory tree
      • sys.path
    • for each kind of sandbox
  3. Processing Distributions

    1. Grab a source distribution

      $ /sandbox/bin/easy_install --editable --build-directory . SQLObject==0.9.5
      $ /sandbox/bin/easy_install --editable --build-directory . SQLObject==dev

      Examine its directory structure and common files.

    2. Query the list of available distribution formats.

      $ cd sqlobject
      $ /sandbox/bin/python setup.py sdist --help-formats
      $ /sandbox/bin/python setup.py bdist --help-formats
    3. Build and package it as a binary distribution.

      $ /sandbox/bin/python setup.py build
      $ /sandbox/bin/python setup.py install
      $ /sandbox/bin/python setup.py bdist --formats=tar,egg,rpm

      Examine the run output and the table-of-contents of the distribution archive afterward. Note the way that metadata is stored.

    4. Repackage it as a source distribution

      $ /sandbox/bin/python setup.py sdist --formats=zip

      Examine the run output and the table-of-contents of the source archive. Note the different way that metadata is stored.

    5. Try to import it, then run the "develop" cmd and try again.

      $ cd /sandbox
      $ /sandbox/bin/python
      $ import sqlobject
      $ cd /sandbox/sqlobject
      $ /sandbox/bin/python setup.py develop
  4. ???

buildout/pycon2008 tutorial (last edited 2013-02-27 12:02:22 by MichaelCarlsson)

Unable to edit the page? See the FrontPage for instructions.