[Checkins] SVN: lovely.recipe/trunk/ version bump, documentation, cleanup, fixes in eggbox, see changes.txt

Bernd Dorn bernd.dorn at lovelysystems.com
Thu Aug 27 04:48:03 EDT 2009


Log message for revision 103247:
  version bump, documentation, cleanup, fixes in eggbox, see changes.txt

Changed:
  _U  lovely.recipe/trunk/
  U   lovely.recipe/trunk/CHANGES.txt
  U   lovely.recipe/trunk/buildout.cfg
  U   lovely.recipe/trunk/setup.py
  U   lovely.recipe/trunk/src/lovely/recipe/egg/README.txt
  U   lovely.recipe/trunk/src/lovely/recipe/egg/__init__.py
  U   lovely.recipe/trunk/src/lovely/recipe/i18n/tests.py
  U   lovely.recipe/trunk/src/lovely/recipe/importchecker/README.txt
  U   lovely.recipe/trunk/src/lovely/recipe/importchecker/app.py
  U   lovely.recipe/trunk/src/lovely/recipe/testing.py
  U   lovely.recipe/trunk/src/lovely/recipe/zeo/server.py
  U   lovely.recipe/trunk/src/lovely/recipe/zope/zope.py

-=-

Property changes on: lovely.recipe/trunk
___________________________________________________________________
Modified: svn:ignore
   - bin
build
dist
lib
develop-eggs
eggs
parts
.installed.cfg

   + bin
build
dist
lib
develop-eggs
eggs
parts
.installed.cfg
doc.txt


Modified: lovely.recipe/trunk/CHANGES.txt
===================================================================
--- lovely.recipe/trunk/CHANGES.txt	2009-08-27 07:21:30 UTC (rev 103246)
+++ lovely.recipe/trunk/CHANGES.txt	2009-08-27 08:48:03 UTC (rev 103247)
@@ -2,6 +2,22 @@
 Changes for lovely.recipe
 =========================
 
+2009/08/27 1.0.0b6
+==================
+
+ - removed unused dependencies in setup.py
+
+ - generate doc from readmes and use it as long_description in setup,
+   a doc.txt file is generated when setup.py gets executed. this
+   method is taken from zc.buildout's setup.py.
+
+ - lovely.recipe.eggbox does not copy contents of develop eggs anymore
+   if zip is off (better for development).
+
+ - fixed interpreter option in lovely.recipe.eggbox
+
+ - cleaned up test setup and imports
+
 2009/06/18 1.0.0b5
 ==================
 

Modified: lovely.recipe/trunk/buildout.cfg
===================================================================
--- lovely.recipe/trunk/buildout.cfg	2009-08-27 07:21:30 UTC (rev 103246)
+++ lovely.recipe/trunk/buildout.cfg	2009-08-27 08:48:03 UTC (rev 103247)
@@ -1,8 +1,12 @@
 [buildout]
 develop = .
-parts = test
+parts = test importchecker
 
 [test]
 recipe = zc.recipe.testrunner
 eggs = lovely.recipe[zope]
 defaults = ['--auto-color']
+
+[importchecker]
+recipe = lovely.recipe:importchecker
+path = src/lovely
\ No newline at end of file

Modified: lovely.recipe/trunk/setup.py
===================================================================
--- lovely.recipe/trunk/setup.py	2009-08-27 07:21:30 UTC (rev 103246)
+++ lovely.recipe/trunk/setup.py	2009-08-27 08:48:03 UTC (rev 103247)
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
 from setuptools import setup, find_packages
+import os
+
 entry_points = """
 [zc.buildout]
 mkdir = lovely.recipe.fs.mkdir:Mkdir
@@ -12,10 +14,31 @@
 eggbox = lovely.recipe.egg:EggBox
 """
 
+def read(*rnames):
+    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+long_description=(
+        'Lovely Recipes\n'
+        '**************\n'
+        + '\n' +
+        read('src', 'lovely', 'recipe', 'fs', 'README.txt')
+        + '\n' +
+        read('src', 'lovely', 'recipe', 'egg', 'README.txt')
+        + '\n' +
+        read('src', 'lovely', 'recipe', 'i18n', 'README.txt')
+        + '\n' +
+        read('src', 'lovely', 'recipe', 'importchecker', 'README.txt')
+        + '\n'
+        )
+
+open('doc.txt', 'w').write(long_description)
+
+
 setup (
     name='lovely.recipe',
-    description = "set of helper recipies for zc.buildout",
-    version='1.0.0b5',
+    description = "Set of helper recipies for zc.buildout",
+    long_description = long_description,
+    version='1.0.0b6',
     author = "Lovely Systems",
     author_email = "office at lovelysystems.com",
     license = "ZPL 2.1",
@@ -26,7 +49,6 @@
     package_dir = {'':'src'},
     namespace_packages = ['lovely', 'lovely.recipe'],
     extras_require = dict(zope=[
-                        'zope.app.locales',
                         'zope.error',
                         'zc.zope3recipes',
                         'zc.zodbrecipes',

Modified: lovely.recipe/trunk/src/lovely/recipe/egg/README.txt
===================================================================
--- lovely.recipe/trunk/src/lovely/recipe/egg/README.txt	2009-08-27 07:21:30 UTC (rev 103246)
+++ lovely.recipe/trunk/src/lovely/recipe/egg/README.txt	2009-08-27 08:48:03 UTC (rev 103247)
@@ -10,30 +10,45 @@
 so it can be referenced by other buildout sections which may want to
 use the recipe.
 
+    >>> import os
+    >>> lovely_recipy_loc = os.path.dirname(os.path.dirname(os.path.dirname(
+    ...     os.path.dirname(os.path.dirname(__file__)))))
+
     >>> write(sample_buildout, 'buildout.cfg',
     ... """
     ... [buildout]
+    ... develop = %s
     ... parts = packages
-    ... find-links = http://download.zope.org/distribution
     ...
     ... [packages]
     ... recipe = lovely.recipe:eggbox
-    ... eggs = zope.dublincore
-    ...        zope.formlib
-    ...        pytz
-    ... """)
-    >>> print system(buildout),
-    Getting...
-    Installing packages.
+    ... eggs = pytz
+    ...        lovely.recipe
+    ... interpreter = py
+    ... """ % lovely_recipy_loc)
 
+    >>> 'Installing packages.' in system(buildout + ' -o')
+    True
+
+
 We now have a zip file for each top-level directory. Note that the
 zip-files are ending with .egg for pkg_resources compatibility.
 
     >>> ls(sample_buildout + '/parts/packages')
-    -  BTrees.egg
-    -  RestrictedPython.egg...
-    -  zope.egg
+    -  lovely.egg
+    -  pytz.egg
+    -  zc.egg
 
+The generated interpreter now has the pytz zip file in the path.
+
+    >>> cat(sample_buildout + '/bin/py')
+    #!...
+    sys.path[0:0] = [
+      '/sample-buildout/parts/packages/lovely.egg',
+      '/sample-buildout/parts/packages/pytz.egg',
+      '/sample-buildout/parts/packages/zc.egg',
+      ]...
+
 It is possible to disable zipping. And also to exclude or include
 patterns of files. So for example we can strip down pytz. We can also
 create a script.
@@ -41,6 +56,7 @@
     >>> write(sample_buildout, 'buildout.cfg',
     ... """
     ... [buildout]
+    ... develop = %s
     ... parts = packages test
     ... find-links = http://download.zope.org/distribution
     ...
@@ -48,6 +64,7 @@
     ... zip = False
     ... recipe = lovely.recipe:eggbox
     ... eggs = pytz
+    ...        lovely.recipe
     ... excludes = ^pytz/zoneinfo/Mexico/.*
     ...
     ... [test]
@@ -55,15 +72,30 @@
     ... eggs = lovely.recipe
     ... extra-paths = ${packages:path}
     ... interpreter = py
-    ... """)
+    ... """ % lovely_recipy_loc)
     >>> print system(buildout),
+    Develop: '...'
     Uninstalling packages.
     Installing packages.
     Installing test.
     Generated interpreter '/sample-buildout/bin/py'.
 
+Note that we still have the same directory structure as the zipped
+version with a directory for each top-level namespace.  The 'lovely'
+directory is not in he packages directory because it is a develop egg
+and we have set zipped to false, therefore it is only added to the
+python path.
+
     >>> ls(sample_buildout + '/parts/packages')
     d  pytz
+    d  zc
+
+    >>> print system(join(sample_buildout, 'bin', 'py') + \
+    ...        ' -c "import lovely.recipe; print lovely.recipe.__file__"')
+    /.../src/lovely/recipe/__init__.py...
+
+
+
     >>> ls(sample_buildout + '/parts/packages/pytz/pytz/zoneinfo/Mexico')
     Traceback (most recent call last):
     ...
@@ -75,16 +107,20 @@
     -  Anguilla
     -  ...
 
-Note that we still have the same directory structure as the zipped
-version with a directory for each top-level namespace.
+The test section uses the path of our packages section. Note that due,
+to the development path of lovely.recipe this path is actually
+included twice because the script recipe does not check duplicates.
 
-
-The test section uses the path of our packages section.
-
     >>> cat(sample_buildout + '/bin/py')
     #!...
-    import sys
-    <BLANKLINE>
-    sys.path[0:0] = [.../sample-buildout/parts/packages/pytz',
+    sys.path[0:0] = [
+      '/.../src',
+      '/Users/bd/.buildout/eggs/zc.recipe.egg-...egg',
+      '/sample-buildout/eggs/zc.buildout-...egg',
+      '/opt/local/lib/python2.5/site-packages',
+      '/.../src',
+      '/sample-buildout/parts/packages/pytz',
+      '/sample-buildout/parts/packages/zc',
       ]...
 
+

Modified: lovely.recipe/trunk/src/lovely/recipe/egg/__init__.py
===================================================================
--- lovely.recipe/trunk/src/lovely/recipe/egg/__init__.py	2009-08-27 07:21:30 UTC (rev 103246)
+++ lovely.recipe/trunk/src/lovely/recipe/egg/__init__.py	2009-08-27 08:48:03 UTC (rev 103247)
@@ -1,10 +1,13 @@
 import logging, os
-import zc.recipe.egg
+import re
 import shutil
-import re
+
 import pkg_resources
-from zc.buildout.easy_install import _script
 
+import zc.recipe.egg
+from zc.buildout.easy_install import _script, _pyscript, _relative_path_and_setup
+
+
 log = logging.getLogger(__name__)
 
 SKIPPED_LIBDIRS = ('site-packages',)
@@ -20,10 +23,19 @@
     def __init__(self, buildout, name, options):
         options['parts-directory'] = buildout['buildout']['parts-directory']
         super(EggBox, self).__init__(buildout, name, options)
+
+        develop = self.buildout['buildout'].get('develop', [])
+        self.develop_paths = []
+        if develop:
+            for setup in develop.split():
+                self.develop_paths.append(
+                    os.path.normpath(self.buildout._buildout_path(setup)))
+
         # we need to do this on init because the signature cannot be
         # created if the egg is not already there
         self.ws = self.working_set()[1]
         self.zip = self.options.get('zip') != 'False'
+
         self.location = self.options.get(
             'location',
             os.path.join(self.options['parts-directory'], self.name))
@@ -31,6 +43,7 @@
             self.includes += map(re.compile, options.get('includes').strip().split())
         if options.get('excludes'):
             self.excludes += map(re.compile, options.get('excludes').strip().split())
+
         self._mk_zips()
 
     def progress_filter(self, packages):
@@ -85,9 +98,13 @@
             shutil.rmtree(self.location)
         os.mkdir(self.location)
         dsts = []
+        path = []
         for src, names in self.ws.entry_keys.items():
             if self.src_exclude.match(src):
                 continue
+            if not self.zip and filter(src.startswith, self.develop_paths):
+                path.append(src)
+                continue
             log.debug("Adding archive %r %r" % (src, names))
             archive_util.unpack_archive(
                 src, self.location, progress_filter=self.progress_filter(names))
@@ -114,7 +131,6 @@
                 z = os.path.join(self.location, name + '.egg')
                 make_zipfile(z, d)
                 shutil.rmtree(d)
-        path = []
         for name in os.listdir(self.location):
             path.append(os.path.join(self.location, name))
         self.options['path'] = '\n'.join(path)
@@ -126,7 +142,10 @@
                 arguments='',
                 interpreter=None,
                 initialization='',
+                relative_paths=False,
                 ):
+
+        path = [dist.location for dist in working_set]
         path = list(self.path)
         path.extend(extra_paths)
         path = repr(path)[1:-1].replace(', ', ',\n  ')
@@ -166,9 +185,9 @@
                 _script(module_name, attrs, path, sname, executable, arguments,
                         initialization)
                 )
-
         if interpreter:
             sname = os.path.join(dest, interpreter)
-            generated.extend(_pyscript(path, sname, executable))
+            spath, rpsetup = _relative_path_and_setup(sname, path, relative_paths)
+            generated.extend(_pyscript(path, sname, executable, rpsetup))
 
         return generated

Modified: lovely.recipe/trunk/src/lovely/recipe/i18n/tests.py
===================================================================
--- lovely.recipe/trunk/src/lovely/recipe/i18n/tests.py	2009-08-27 07:21:30 UTC (rev 103246)
+++ lovely.recipe/trunk/src/lovely/recipe/i18n/tests.py	2009-08-27 08:48:03 UTC (rev 103247)
@@ -16,17 +16,20 @@
 """
 __docformat__ = 'restructuredtext'
 
-from zc.buildout import testing
-import doctest, unittest
+import unittest
 from zope.testing import doctest, renormalizing
-
 from lovely.recipe.testing import setUpBuildout
+from zc.buildout import testing
 
+def setUp(test):
+    setUpBuildout(test)
+    testing.install_develop('zope.app.locales', test)
+    testing.install_develop('zope.i18nmessageid', test)
 
 def test_suite():
     return unittest.TestSuite((
         doctest.DocFileSuite('README.txt',
-                             setUp=setUpBuildout,
+                             setUp=setUp,
                              tearDown=testing.buildoutTearDown,
                              optionflags=doctest.ELLIPSIS,
                              checker=renormalizing.RENormalizing([

Modified: lovely.recipe/trunk/src/lovely/recipe/importchecker/README.txt
===================================================================
--- lovely.recipe/trunk/src/lovely/recipe/importchecker/README.txt	2009-08-27 07:21:30 UTC (rev 103246)
+++ lovely.recipe/trunk/src/lovely/recipe/importchecker/README.txt	2009-08-27 08:48:03 UTC (rev 103247)
@@ -1,12 +1,12 @@
-=================
-i18n Tools Recipe
-=================
+====================
+Importchecker Recipe
+====================
 
 This recipe creates an importchecker instance in the bin directory.
 
 
-Creating The Tools
-==================
+Creating The Script
+===================
 
     >>> write(sample_buildout, 'buildout.cfg',
     ... """

Modified: lovely.recipe/trunk/src/lovely/recipe/importchecker/app.py
===================================================================
--- lovely.recipe/trunk/src/lovely/recipe/importchecker/app.py	2009-08-27 07:21:30 UTC (rev 103246)
+++ lovely.recipe/trunk/src/lovely/recipe/importchecker/app.py	2009-08-27 08:48:03 UTC (rev 103247)
@@ -16,7 +16,6 @@
 """
 __docformat__ = 'restructuredtext'
 
-import os
 import logging
 
 import zc.buildout

Modified: lovely.recipe/trunk/src/lovely/recipe/testing.py
===================================================================
--- lovely.recipe/trunk/src/lovely/recipe/testing.py	2009-08-27 07:21:30 UTC (rev 103246)
+++ lovely.recipe/trunk/src/lovely/recipe/testing.py	2009-08-27 08:48:03 UTC (rev 103247)
@@ -1,87 +1,8 @@
 from zc.buildout import testing
 
-
 def setUpBuildout(test):
     testing.buildoutSetUp(test)
     testing.install_develop('zc.recipe.egg', test)
-    testing.install_develop('zc.zodbrecipes', test)
-    testing.install_develop('zc.zope3recipes', test)
     testing.install_develop('lovely.recipe', test)
-    testing.install_develop('ZODB3', test)
-    testing.install_develop('docutils', test)
-    testing.install_develop('zodbcode', test)
     testing.install_develop('pytz', test)
-    testing.install_develop('RestrictedPython', test)
-    testing.install_develop('zdaemon', test)
-    testing.install_develop('ZConfig', test)
-    testing.install_develop('zope.annotation', test)
-    testing.install_develop('zope.cachedescriptors', test)
-    testing.install_develop('zope.configuration', test)
-    testing.install_develop('zope.component', test)
-    testing.install_develop('zope.contenttype', test)
-    testing.install_develop('zope.copypastemove', test)
-    testing.install_develop('zope.deprecation', test)
-    testing.install_develop('zope.dublincore', test)
-    testing.install_develop('zope.error', test)
-    testing.install_develop('zope.filerepresentation', test)
-    testing.install_develop('zope.formlib', test)
     testing.install_develop('zope.interface', test)
-    testing.install_develop('zope.i18nmessageid', test)
-    testing.install_develop('zope.i18n', test)
-    testing.install_develop('zope.datetime', test)
-    testing.install_develop('zope.deferredimport', test)
-    testing.install_develop('zope.dottedname', test)
-    testing.install_develop('zope.event', test)
-    testing.install_develop('zope.exceptions', test)
-    testing.install_develop('zope.hookable', test)
-    testing.install_develop('zope.minmax', test)
-    testing.install_develop('zope.modulealias', test)
-    testing.install_develop('zope.pagetemplate', test)
-    testing.install_develop('zope.proxy', test)
-    testing.install_develop('zope.publisher', test)
-    testing.install_develop('zope.size', test)
-    testing.install_develop('zope.security', test)
-    testing.install_develop('zope.session', test)
-    testing.install_develop('zope.lifecycleevent', test)
-    testing.install_develop('zope.location', test)
-    testing.install_develop('zope.schema', test)
-    testing.install_develop('zope.structuredtext', test)
-    testing.install_develop('zope.tal', test)
-    testing.install_develop('zope.tales', test)
-    testing.install_develop('zope.testing', test)
-    testing.install_develop('zope.thread', test)
-    testing.install_develop('zope.traversing', test)
-    testing.install_develop('zope.app.appsetup', test)
-    testing.install_develop('zope.app.authentication', test)
-    testing.install_develop('zope.app.applicationcontrol', test)
-    testing.install_develop('zope.app.basicskin', test)
-    testing.install_develop('zope.app.broken', test)
-    testing.install_develop('zope.app.container', test)
-    testing.install_develop('zope.app.content', test)
-    testing.install_develop('zope.app.component', test)
-    testing.install_develop('zope.app.debug', test)
-    testing.install_develop('zope.app.dependable', test)
-    testing.install_develop('zope.app.error', test)
-    testing.install_develop('zope.app.exception', test)
-    testing.install_develop('zope.app.folder', test)
-    testing.install_develop('zope.app.form', test)
-    testing.install_develop('zope.app.generations', test)
-    testing.install_develop('zope.app.http', test)
-    testing.install_develop('zope.app.i18n', test)
-    testing.install_develop('zope.app.interface', test)
-    testing.install_develop('zope.app.locales', test)
-    testing.install_develop('zope.app.pagetemplate', test)
-    testing.install_develop('zope.app.principalannotation', test)
-    testing.install_develop('zope.app.publication', test)
-    testing.install_develop('zope.app.publisher', test)
-    testing.install_develop('zope.app.renderer', test)
-    testing.install_develop('zope.app.rotterdam', test)
-    testing.install_develop('zope.app.schema', test)
-    testing.install_develop('zope.app.security', test)
-    testing.install_develop('zope.app.session', test)
-    testing.install_develop('zope.app.testing', test)
-    testing.install_develop('zope.app.wsgi', test)
-    testing.install_develop('zope.app.zapi', test)
-    testing.install_develop('zope.app.zcmlfiles', test)
-    testing.install_develop('zope.app.zopeappgenerations', test)
-

Modified: lovely.recipe/trunk/src/lovely/recipe/zeo/server.py
===================================================================
--- lovely.recipe/trunk/src/lovely/recipe/zeo/server.py	2009-08-27 07:21:30 UTC (rev 103246)
+++ lovely.recipe/trunk/src/lovely/recipe/zeo/server.py	2009-08-27 08:48:03 UTC (rev 103247)
@@ -17,11 +17,6 @@
 __docformat__ = 'restructuredtext'
 
 import socket
-import cStringIO
-import os, shutil
-import zc.buildout
-import zc.recipe.egg
-
 from lovely.recipe import TemplatedRecipe
 
 from zc.zodbrecipes import StorageServer

Modified: lovely.recipe/trunk/src/lovely/recipe/zope/zope.py
===================================================================
--- lovely.recipe/trunk/src/lovely/recipe/zope/zope.py	2009-08-27 07:21:30 UTC (rev 103246)
+++ lovely.recipe/trunk/src/lovely/recipe/zope/zope.py	2009-08-27 08:48:03 UTC (rev 103247)
@@ -20,7 +20,6 @@
 import cStringIO
 import os, shutil
 import zc.buildout
-import zc.recipe.egg
 import ZConfig.cfgparser
 from zc.zope3recipes.recipes import (Instance,
                                      App,



More information about the Checkins mailing list