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

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg-security/TI12-security/trunk/NDGSecurity/python/buildout/ndgsecurity/eggs/zc.buildout-1.2.1-py2.5.egg/zc/buildout/setup.txt@7081
Revision 7081, 1.8 KB checked in by pjkersha, 11 years ago (diff)
  • Property svn:keywords set to Id
Line 
1Using zc.buildout to run setup scripts
2======================================
3
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.
9
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:
18
19    >>> mkdir('test')
20    >>> cd('test')
21    >>> write('setup.py',
22    ... '''
23    ... from distutils.core import setup
24    ... setup(name='sample')
25    ... ''')
26
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:
30
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.
34
35Oops, we forgot to give the name of the setup script:
36
37    >>> print system(buildout+' setup setup.py bdist_egg'), # doctest: +ELLIPSIS
38    Running setup script 'setup.py'.
39    ...
40
41    >>> ls('dist')
42    -  sample-0.0.0-py2.5.egg
43
44Note that we can specify a directory name.  This is often shorter and
45preferred by the lazy :)
46
47    >>> print system(buildout+' setup . bdist_egg'), # doctest: +ELLIPSIS
48    Running setup script './setup.py'.
49    ...
Note: See TracBrowser for help on using the repository browser.