Commit eca5fb0a authored by jim's avatar jim

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


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@73397 62d5b8a3-27da-0310-9561-8e5933582275
parent 9a657904
......@@ -16,9 +16,11 @@
$Id$
"""
import os, re, zipfile
import logging, os, re, zipfile
import zc.buildout.easy_install
logger = logging.getLogger(__name__)
class Base:
def __init__(self, buildout, name, options):
......@@ -65,7 +67,17 @@ class Custom(Base):
def install(self):
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(
distribution, options['_d'], self.build_ext,
self.links, self.index, options['executable'], [options['_e']],
......
......@@ -59,8 +59,8 @@ swig-opts
In addition, the following options can be used to specify the egg:
egg
An eggs to install given as a setuptools requirement string.
This defaults to the part name.
An specification for the egg to be created, to install given as a
setuptools requirement string. This defaults to the part name.
find-links
A list of URLs, files, or directories to search for distributions.
......@@ -242,6 +242,43 @@ will:
d extdemo-1.5-py2.4-linux-i686.egg
- 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
==================================
......@@ -342,9 +379,10 @@ set with a value of 2.
>>> print system(buildout),
buildout: Develop: /sample-buildout/demo
buildout: Uninstalling demo
buildout: Uninstalling extdemo
buildout: Installing extdemo
buildout: Updating demo
buildout: Installing demo
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