Commit 1f5193f5 authored by Jim Fulton's avatar Jim Fulton

Updated for DZUG.

parent 8f81a311
...@@ -10,7 +10,7 @@ Introduction to zc.buildout ...@@ -10,7 +10,7 @@ Introduction to zc.buildout
Jim Fulton, Zope Corporation Jim Fulton, Zope Corporation
PyCon 2007 DZUG 2007
What is zc.buildout? What is zc.buildout?
==================== ====================
...@@ -125,7 +125,7 @@ Working with eggs ...@@ -125,7 +125,7 @@ Working with eggs
I often switch between develop and non-develop eggs. I may be 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 using a regular egg and realize I need to fix it. I checkout the
eggs project into my buildout and tell buildout to treat it as a 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 develop egg. It creates the egg link in develop eggs and will
load the develop egg in preference to the non-develop egg. load the develop egg in preference to the non-develop egg.
...@@ -161,23 +161,6 @@ zc.buildout current status ...@@ -161,23 +161,6 @@ zc.buildout current status
- A number of "recipes" available - A number of "recipes" available
- Error reporting needs **a lot** of improvement
.. class:: handout
This will be a focus in the coming weeks.
- Need a way to record versions used for repeatability
.. class:: handout
A benefit of using eggs is that dependencies are installed
automatically. To make buildouts repeatable, we need a way to
capture the versions used in development, so we can include them
in a buildout specification that we can check in. Of course, we
can do this manually today, but it needs to be automated.
A Python Egg Primer A Python Egg Primer
=================== ===================
...@@ -193,7 +176,7 @@ Eggs are simple! ...@@ -193,7 +176,7 @@ Eggs are simple!
- dependencies - dependencies
- entry point - entry points
- May be distributed as source distributions - May be distributed as source distributions
...@@ -204,7 +187,6 @@ Eggs are simple! ...@@ -204,7 +187,6 @@ Eggs are simple!
source distributions are more convenient to distribute in a lot source distributions are more convenient to distribute in a lot
of ways. of ways.
- Automatic discovery through PyPI - Automatic discovery through PyPI
Egg jargon Egg jargon
...@@ -346,7 +328,7 @@ Buildout overview ...@@ -346,7 +328,7 @@ Buildout overview
.. class:: handout .. class:: handout
If a part is removed from a specification, or is uninstalled. If a part is removed from a specification, it is uninstalled.
If a part's recipe or configuration changes, it is uninstalled If a part's recipe or configuration changes, it is uninstalled
and reinstalled. and reinstalled.
...@@ -483,9 +465,9 @@ zope.event buildout.cfg ...@@ -483,9 +465,9 @@ zope.event buildout.cfg
eggs = zope.event eggs = zope.event
The zc.recipe.testrunnner recipe has an eggs option for specifying which eggs should The zc.recipe.testrunnner recipe has an eggs option for specifying
be tested. The generated test script will load these eggs along which eggs should be tested. The generated test script will load
with their dependencies. these eggs along with their dependencies.
For more information on the ``zc.recipe.testrunner`` recipe, see For more information on the ``zc.recipe.testrunner`` recipe, see
http://www.python.org/pypi/zc.recipe.testrunner. http://www.python.org/pypi/zc.recipe.testrunner.
...@@ -521,7 +503,7 @@ Buildout steps ...@@ -521,7 +503,7 @@ Buildout steps
:: ::
bin/buildout setup . egg_info -r sdist register upload bin/buildout setup . egg_info -rbdev sdist register upload
.. class:: handout .. class:: handout
...@@ -547,7 +529,10 @@ Buildout steps ...@@ -547,7 +529,10 @@ Buildout steps
The egg_info command allows control of egg meta-data. The -r The egg_info command allows control of egg meta-data. The -r
option to the egg_info command causes the distribution to have a option to the egg_info command causes the distribution to have a
version number that includes the subversion revision number of version number that includes the subversion revision number of
the project. This is useful when making development releases. the project. The -b option specified a revision tag. Here we
specified a revision tag of "dev", which marks the release as a
devlopment release. These are useful when making development
releases.
Exercise 1 Exercise 1
=========== ===========
...@@ -736,27 +721,7 @@ Polished ``setup.py`` (1/3) ...@@ -736,27 +721,7 @@ Polished ``setup.py`` (1/3)
def read(*rnames): def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read() return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
name='zope.event' long_description=(
setup(
name=name,
version='3.3.0',
url='http://www.python.org/pypi/'+name,
license='ZPL 2.1',
description='Zope Event Publication',
author='Zope Corporation and Contributors',
author_email='zope3-dev@zope.org',
.. class:: handout
In the polished version we flesh out the meta data a bit more.
Polished ``setup.py`` (2/3)
===========================
.. code-block:: Python
long_description=(
read('README.txt') read('README.txt')
+ '\n' + + '\n' +
'Detailed Documentation\n' 'Detailed Documentation\n'
...@@ -766,26 +731,41 @@ Polished ``setup.py`` (2/3) ...@@ -766,26 +731,41 @@ Polished ``setup.py`` (2/3)
+ '\n' + + '\n' +
'Download\n' 'Download\n'
'**********************\n' '**********************\n'
), )
open('documentation.txt', 'w').write(long_description)
.. class:: handout .. class:: handout
When I create distributions that I consider ready for broader use In the polished version we flesh out the meta data a bit more.
and upload to PyPI, I like to include the full documentation in the
long description so PyPI serves it for me.
Polished ``setup.py`` (3/3) When I create distributions that I consider ready for broader use and
upload to PyPI, I like to include the full documentation in the long
description so PyPI serves it for me.
Polished ``setup.py`` (2/3)
=========================== ===========================
.. code-block:: Python .. code-block:: Python
packages=find_packages('src'), name='zope.event'
package_dir = {'': 'src'}, setup(
namespace_packages=['zope',], name=name,
include_package_data = True, version='3.3.0',
install_requires=['setuptools'], url='http://www.python.org/pypi/'+name,
zip_safe = False, license='ZPL 2.1',
) description='Zope Event Publication',
author='Zope Corporation and Contributors',
author_email='zope3-dev@zope.org',
long_description=long_description,
packages=find_packages('src'),
package_dir = {'': 'src'},
namespace_packages=['zope',],
include_package_data = True,
install_requires=['setuptools'],
zip_safe = False,
)
Extras Extras
====== ======
...@@ -823,8 +803,7 @@ Extras ...@@ -823,8 +803,7 @@ Extras
depenencies. A package may provide other optional features that depenencies. A package may provide other optional features that
cause other dependencies. For example, the zcml module in cause other dependencies. For example, the zcml module in
zope.component adds lots of depenencies that we don't want to zope.component adds lots of depenencies that we don't want to
impose on people that don't use it. impose on people that don't use it.
``zc.recipe.egg`` ``zc.recipe.egg``
================= =================
...@@ -971,6 +950,7 @@ Custom egg building ...@@ -971,6 +950,7 @@ Custom egg building
find-links = http://www.python.org/other/spread/ find-links = http://www.python.org/other/spread/
include-dirs = ${spreadtoolkit:location}/include include-dirs = ${spreadtoolkit:location}/include
library-dirs = ${spreadtoolkit:location}/lib library-dirs = ${spreadtoolkit:location}/lib
rpath = ${spreadtoolkit:location}/lib
.. class:: handout .. class:: handout
...@@ -1478,10 +1458,16 @@ RPM experiments ...@@ -1478,10 +1458,16 @@ RPM experiments
Initial work creating RPMs for deployment in our hosting environment: Initial work creating RPMs for deployment in our hosting environment:
- Separation of software and configuration
- Buildout used to create rpm containing software - Buildout used to create rpm containing software
- Later, the installed buildout is used to set up specific processes - Later, the installed buildout is used to set up specific processes
- Run as root in offline mode
- Uses network configuration server
.. class:: handout .. class:: handout
Our philosophy is to separate software and configuration. We Our philosophy is to separate software and configuration. We
...@@ -1640,7 +1626,35 @@ ZRS spec file (3/3) ...@@ -1640,7 +1626,35 @@ ZRS spec file (3/3)
We specify the files to be installed. This is just the buildout We specify the files to be installed. This is just the buildout
directory and a configuration script. directory and a configuration script.
Repeatability
=============
We want to be able to check certtain configuration into svn that can
be checked out and reproduced.
- We let buildout tell is what versions it picked for distributions
- Run with -v
- Look for outout lines of form:
::
Picked: foo = 1.2
- Include a versions section:
::
[buildout]
...
versions = myversions
[myversions]
foo = 1.2
...
Deployment issues Deployment issues
================= =================
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment