source: TI12-security/trunk/NDGSecurity/python/buildout/ndgsecurity/eggs/zc.buildout-1.2.1-py2.5.egg/zc/buildout/setup.txt @ 7081

Subversion URL:
Revision 7081, 1.8 KB checked in by pjkersha, 11 years ago (diff)
  • Property svn:keywords set to Id
1Using zc.buildout to run setup scripts
4zc buildout has a convenience command for running setup scripts.  Why?
5There are two reasons.  If a setup script doesn't import setuptools,
6you can't use any setuptools-provided commands, like bdist_egg.  When
7buildout runs a setup script, it arranges to import setuptools before
8running the script so setuptools-provided commands are available.
10If you use a squeaky-clean Python to do your development, the setup
11script that would import setuptools because setuptools isn't in the
12path.  Because buildout requires setuptools and knows where it has
13installed a setuptools egg, it adds the setuptools egg to the Python
14path before running the script.  To run a setup script, use the
15buildout setup command, passing the name of a script or a directory
16containing a setup script and arguments to the script.  Let's look at
17an example:
19    >>> mkdir('test')
20    >>> cd('test')
21    >>> write('',
22    ... '''
23    ... from distutils.core import setup
24    ... setup(name='sample')
25    ... ''')
27We've created a super simple (stupid) setup script.  Note that it
28doesn't import setuptools.  Let's try running it to create an egg.
29We'll use the buildout script from our sample buildout:
31    >>> print system(buildout+' setup'),
32    Error: The setup command requires the path to a setup script or
33    directory containing a setup script, and it's arguments.
35Oops, we forgot to give the name of the setup script:
37    >>> print system(buildout+' setup bdist_egg'), # doctest: +ELLIPSIS
38    Running setup script ''.
39    ...
41    >>> ls('dist')
42    -  sample-0.0.0-py2.5.egg
44Note that we can specify a directory name.  This is often shorter and
45preferred by the lazy :)
47    >>> print system(buildout+' setup . bdist_egg'), # doctest: +ELLIPSIS
48    Running setup script './'.
49    ...
Note: See TracBrowser for help on using the repository browser.