[Checkins] SVN: z3c.recipe.tag/trunk/ support zc.buildout 1.5.0

Gary Poster gary.poster at canonical.com
Sun Aug 29 15:43:52 EDT 2010


Log message for revision 116001:
  support zc.buildout 1.5.0

Changed:
  U   z3c.recipe.tag/trunk/CHANGES.txt
  U   z3c.recipe.tag/trunk/setup.py
  U   z3c.recipe.tag/trunk/src/z3c/recipe/tag/__init__.py

-=-
Modified: z3c.recipe.tag/trunk/CHANGES.txt
===================================================================
--- z3c.recipe.tag/trunk/CHANGES.txt	2010-08-29 19:34:43 UTC (rev 116000)
+++ z3c.recipe.tag/trunk/CHANGES.txt	2010-08-29 19:43:52 UTC (rev 116001)
@@ -2,10 +2,11 @@
 CHANGES
 =======
 
-0.3.1 (unreleased)
+0.4.0 (unreleased)
 ------------------
 
-* ...
+* Support new script features from zc.buildout 1.5 and higher.  This version
+  requires zc.buildout 1.5 or higher.
 
 * Also index Mako and HTML files with id-utils.
 
@@ -17,7 +18,7 @@
 
 * Also index Javascript, CSS and ReStructuredText files with id-utils.
 
-* Define a default entry point for zc.buildout, so you can simply say
+* Define a default entry point for zc.buildout, so you can simply say::
 
     [ctags]
     recipe = z3c.recipe.tag

Modified: z3c.recipe.tag/trunk/setup.py
===================================================================
--- z3c.recipe.tag/trunk/setup.py	2010-08-29 19:34:43 UTC (rev 116000)
+++ z3c.recipe.tag/trunk/setup.py	2010-08-29 19:43:52 UTC (rev 116001)
@@ -33,7 +33,7 @@
 
 setup(
     name="z3c.recipe.tag",
-    version='0.3.1dev',
+    version='0.4.0dev',
     author="Ignas Mikalajūnas and the Zope Community",
     description="Generate ctags from eggs for development.",
     long_description=(read('README.txt')
@@ -57,13 +57,13 @@
     package_dir={'': 'src'},
     namespace_packages=['z3c','z3c.recipe'],
     install_requires=['setuptools',
-                      'zc.buildout',
+                      'zc.buildout >= 1.5.0',
                       #these two come from apt-get!
                       #'id-utils',
                       #'ctags-exuberant'
                       # alternately, on Mac, use macports (macports.org) and
                       # ``sudo port install ctags idutils``
-                      'zc.recipe.egg'],
+                      'z3c.recipe.scripts >= 1.0.0'],
     entry_points="""
     [zc.buildout]
     default = z3c.recipe.tag:TagsMaker

Modified: z3c.recipe.tag/trunk/src/z3c/recipe/tag/__init__.py
===================================================================
--- z3c.recipe.tag/trunk/src/z3c/recipe/tag/__init__.py	2010-08-29 19:34:43 UTC (rev 116000)
+++ z3c.recipe.tag/trunk/src/z3c/recipe/tag/__init__.py	2010-08-29 19:43:52 UTC (rev 116001)
@@ -18,7 +18,7 @@
 import sys
 
 import zc.buildout.easy_install
-import zc.recipe.egg
+import z3c.recipe.scripts.scripts
 
 class TagsMaker(object):
 
@@ -26,30 +26,25 @@
         self.buildout = buildout
         self.name = name
         self.options = options
+        # We do this early so the "extends" functionality works before we get
+        # to the other options below.
+        self._delegated = z3c.recipe.scripts.scripts.Base(
+            buildout, name, options)
         options['script'] = os.path.join(buildout['buildout']['bin-directory'],
                                          options.get('script', self.name),
                                          )
 
-        if not options.get('working-directory', ''):
-            options['location'] = os.path.join(
-                buildout['buildout']['parts-directory'], name)
-        self.egg = zc.recipe.egg.Egg(buildout, name, options)
-
     def install(self):
         options = self.options
-        dest = []
-        eggs, ws = self.egg.working_set(('z3c.recipe.tag',))
+        generated = []
+        eggs, ws = self._delegated.working_set(('z3c.recipe.tag',))
 
-        wd = options.get('working-directory', '')
-        if not wd:
-            wd = options['location']
-            if os.path.exists(wd):
-                assert os.path.isdir(wd)
-            else:
-                os.mkdir(wd)
-            dest.append(wd)
+        if not os.path.exists(options['parts-directory']):
+            os.mkdir(options['parts-directory'])
+            generated.append(options['parts-directory'])
 
-        initialization = initialization_template % self.buildout['buildout']['directory']
+        initialization = initialization_template % (
+            self.buildout['buildout']['directory'])
 
         env_section = options.get('environment', '').strip()
         if env_section:
@@ -61,15 +56,18 @@
         if initialization_section:
             initialization += initialization_section
 
-        dest.extend(zc.buildout.easy_install.scripts(
-            [(options['script'], 'z3c.recipe.tag', 'build_tags')],
-            ws, options['executable'],
-            self.buildout['buildout']['bin-directory'],
-            extra_paths=self.egg.extra_paths,
-            initialization = initialization,
+        generated.extend(zc.buildout.easy_install.sitepackage_safe_scripts(
+            self.buildout['buildout']['bin-directory'], ws,
+            options['executable'], options['parts-directory'],
+            reqs=[(options['script'], 'z3c.recipe.tag', 'build_tags')],
+            extra_paths=self._delegated.extra_paths,
+            include_site_packages=self._delegated.include_site_packages,
+            exec_sitecustomize=self._delegated.exec_sitecustomize,
+            relative_paths=self._delegated._relative_paths,
+            script_initialization=initialization,
             ))
 
-        return dest
+        return generated
 
     update = install
 



More information about the checkins mailing list