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

Subversion URL:
Revision 7081, 1.6 KB checked in by pjkersha, 11 years ago (diff)
  • Property svn:keywords set to Id
1Running setup scripts
4Buildouts are often used to work on packages that will be distributed
5as eggs. During development, we use develop eggs.  When you've
6completed a development cycle, you'll need to run your setup script to
7generate a distribution and, perhaps, uploaded it to the Python
8package index.  If your script uses setuptools, you'll need setuptools
9in your Python path, which may be an issue if you haven't installed
10setuptools into your Python installation.
12The buildout setup command is helpful in a situation like this.  It
13can be used to run a setup script and it does so with the setuptools
14egg in the Python path and with setuptools already imported.  The fact
15that setuptools is imported means that you can use setuptools-based
16commands, like bdist_egg even with packages that don't use setuptools.
17To illustrate this, we'll create a package in a sample buildout:
19    >>> mkdir('hello')
20    >>> write('hello', '', 'print "Hello World!"')
21    >>> write('hello', 'README', 'This is hello')
22    >>> write('hello', '',
23    ... """
24    ... from distutils.core import setup
25    ... setup(name="hello",
26    ...       version="1.0",
27    ...       py_modules=["hello"],
28    ...       author="Bob",
29    ...       author_email="",
30    ...       )
31    ... """)
33We can use the buildout command to generate the hello egg:
35    >>> print system(buildout +' setup hello -q bdist_egg'),
36    Running setup script 'hello/'.
37    zip_safe flag not set; analyzing archive contents...
39The hello directory now has a hello egg in it's dist directory:
41    >>> ls('hello', 'dist')
42    -  hello-1.0-py2.4.egg
Note: See TracBrowser for help on using the repository browser.