Commit 78e894b4 authored by Jim Fulton's avatar Jim Fulton

Added the (documented) egg option and deprecated use of the eggs option.

parent 4df0db1d
...@@ -16,9 +16,11 @@ ...@@ -16,9 +16,11 @@
$Id$ $Id$
""" """
import os, re, zipfile import logging, os, re, zipfile
import zc.buildout.easy_install import zc.buildout.easy_install
logger = logging.getLogger(__name__)
class Base: class Base:
def __init__(self, buildout, name, options): def __init__(self, buildout, name, options):
...@@ -65,7 +67,17 @@ class Custom(Base): ...@@ -65,7 +67,17 @@ class Custom(Base):
def install(self): def install(self):
options = self.options options = self.options
distribution = options.get('eggs', self.name).strip() distribution = options.get('egg')
if distribution is None:
distribution = options.get('eggs')
if distribution is None:
distribution = self.name
else:
logger.warn("The eggs option is deprecated. Use egg instead")
distribution = options.get('egg', options.get('eggs', self.name)
).strip()
return zc.buildout.easy_install.build( return zc.buildout.easy_install.build(
distribution, options['_d'], self.build_ext, distribution, options['_d'], self.build_ext,
self.links, self.index, options['executable'], [options['_e']], self.links, self.index, options['executable'], [options['_e']],
......
...@@ -59,8 +59,8 @@ swig-opts ...@@ -59,8 +59,8 @@ swig-opts
In addition, the following options can be used to specify the egg: In addition, the following options can be used to specify the egg:
egg egg
An eggs to install given as a setuptools requirement string. An specification for the egg to be created, to install given as a
This defaults to the part name. setuptools requirement string. This defaults to the part name.
find-links find-links
A list of URLs, files, or directories to search for distributions. A list of URLs, files, or directories to search for distributions.
...@@ -242,6 +242,43 @@ will: ...@@ -242,6 +242,43 @@ will:
d extdemo-1.5-py2.4-linux-i686.egg d extdemo-1.5-py2.4-linux-i686.egg
- zc.recipe.egg.egg-link - zc.recipe.egg.egg-link
Controlling the version used
----------------------------
We can specify a specific version using the egg option:
>>> write('buildout.cfg',
... """
... [buildout]
... develop = demo
... parts = extdemo demo
...
... [extdemo]
... recipe = zc.recipe.egg:custom
... egg = extdemo ==1.4
... find-links = %(server)s
... index = %(server)s/index
... include-dirs = include
...
... [demo]
... recipe = zc.recipe.egg
... eggs = demo
... extdemo ==1.4
... entry-points = demo=demo:main
... """ % dict(server=link_server))
>>> print system(buildout+' -D'),
buildout: Develop: /sample-buildout/demo
buildout: Uninstalling demo
buildout: Uninstalling extdemo
buildout: Installing extdemo
zip_safe flag not set; analyzing archive contents...
buildout: Installing demo
>>> ls(sample_buildout, 'develop-eggs')
- demo.egg-link
d extdemo-1.4-py2.4-linux-i686.egg
- zc.recipe.egg.egg-link
Controlling develop-egg generation Controlling develop-egg generation
================================== ==================================
...@@ -342,9 +379,10 @@ set with a value of 2. ...@@ -342,9 +379,10 @@ set with a value of 2.
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/demo buildout: Develop: /sample-buildout/demo
buildout: Uninstalling demo
buildout: Uninstalling extdemo buildout: Uninstalling extdemo
buildout: Installing extdemo buildout: Installing extdemo
buildout: Updating demo buildout: Installing demo
Our develop-eggs now includes an egg link for extdemo: Our develop-eggs now includes an egg link for extdemo:
......
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