[Checkins] SVN: zc.buildout/branches/gary-6/ make the buildout script itself safe for a Python with site packages.

Gary Poster gary.poster at canonical.com
Wed Feb 24 10:54:18 EST 2010


Log message for revision 109416:
  make the buildout script itself safe for a Python with site packages.

Changed:
  U   zc.buildout/branches/gary-6/src/zc/buildout/buildout.py
  U   zc.buildout/branches/gary-6/src/zc/buildout/buildout.txt
  U   zc.buildout/branches/gary-6/src/zc/buildout/testing.py
  U   zc.buildout/branches/gary-6/src/zc/buildout/tests.py
  U   zc.buildout/branches/gary-6/z3c.recipe.scripts_/src/z3c/recipe/scripts/README.txt
  U   zc.buildout/branches/gary-6/z3c.recipe.scripts_/src/z3c/recipe/scripts/tests.py

-=-
Modified: zc.buildout/branches/gary-6/src/zc/buildout/buildout.py
===================================================================
--- zc.buildout/branches/gary-6/src/zc/buildout/buildout.py	2010-02-24 15:16:58 UTC (rev 109415)
+++ zc.buildout/branches/gary-6/src/zc/buildout/buildout.py	2010-02-24 15:54:18 UTC (rev 109416)
@@ -391,9 +391,11 @@
         # Create buildout script
         ws = pkg_resources.WorkingSet(entries)
         ws.require('zc.buildout')
-        zc.buildout.easy_install.scripts(
-            ['zc.buildout'], ws, options['executable'],
-            options['bin-directory'])
+        partsdir = os.path.join(options['parts-directory'], 'buildout')
+        os.mkdir(partsdir)
+        zc.buildout.easy_install.sitepackage_safe_scripts(
+            options['bin-directory'], ws, options['executable'], partsdir,
+            reqs=['zc.buildout'])
 
     init = bootstrap
 

Modified: zc.buildout/branches/gary-6/src/zc/buildout/buildout.txt
===================================================================
--- zc.buildout/branches/gary-6/src/zc/buildout/buildout.txt	2010-02-24 15:16:58 UTC (rev 109415)
+++ zc.buildout/branches/gary-6/src/zc/buildout/buildout.txt	2010-02-24 15:54:18 UTC (rev 109416)
@@ -56,10 +56,9 @@
     -  setuptools-0.6-py2.4.egg
     -  zc.buildout-1.0-py2.4.egg
 
-The develop-eggs and parts directories are initially empty:
+The develop-eggs directory is initially empty:
 
     >>> ls(sample_buildout, 'develop-eggs')
-    >>> ls(sample_buildout, 'parts')
 
 The develop-eggs directory holds egg links for software being
 developed in the buildout.  We separate develop-eggs and other eggs to
@@ -69,6 +68,12 @@
 allows larger buildouts to be set up much more quickly and saves disk
 space.
 
+The parts directory just contains some helpers for the buildout script
+itself.
+
+    >>> ls(sample_buildout, 'parts')
+    d  buildout
+
 The parts directory provides an area where recipes can install
 part data.  For example, if we built a custom Python, we would
 install it in the part directory.  Part data is stored in a

Modified: zc.buildout/branches/gary-6/src/zc/buildout/testing.py
===================================================================
--- zc.buildout/branches/gary-6/src/zc/buildout/testing.py	2010-02-24 15:16:58 UTC (rev 109415)
+++ zc.buildout/branches/gary-6/src/zc/buildout/testing.py	2010-02-24 15:54:18 UTC (rev 109416)
@@ -374,19 +374,6 @@
         return (
             os.path.join(buildout, 'bin', 'py'), site_packages_dir)
 
-    buildout = os.path.join(sample, 'bin', 'buildout')
-
-    def do_build(buildout=buildout, python=None, args=()):
-        if python is None:
-            return system(buildout)
-        if sys.platform == 'win32':
-            # We need to find the "real" script.
-            buildout += '-script.py'
-        cmd = [python, buildout]
-        cmd.extend(args)
-        return system(zc.buildout.easy_install._safe_arg(
-            ' '.join(zc.buildout.easy_install._safe_arg(arg) for arg in cmd)))
-
     test.globs.update(dict(
         sample_buildout = sample,
         ls = ls,
@@ -397,7 +384,6 @@
         tmpdir = tmpdir,
         write = write,
         system = system,
-        do_build=do_build,
         call_py = call_py,
         get = get,
         cd = (lambda *path: os.chdir(os.path.join(*path))),
@@ -405,7 +391,7 @@
         sdist = sdist,
         bdist_egg = bdist_egg,
         start_server = start_server,
-        buildout = buildout,
+        buildout = os.path.join(sample, 'bin', 'buildout'),
         wait_until = wait_until,
         make_py = make_py
         ))

Modified: zc.buildout/branches/gary-6/src/zc/buildout/tests.py
===================================================================
--- zc.buildout/branches/gary-6/src/zc/buildout/tests.py	2010-02-24 15:16:58 UTC (rev 109415)
+++ zc.buildout/branches/gary-6/src/zc/buildout/tests.py	2010-02-24 15:54:18 UTC (rev 109416)
@@ -420,7 +420,7 @@
 indicate the eggs from site-packages that have been selected.  You'll see
 we have two: demo 0.3 and demoneeded 1.1.
 
-    >>> print do_build(python=py_path, args=['-v'])
+    >>> print system(buildout+" -v")
     Installing 'zc.buildout', 'setuptools'.
     We have a develop egg: zc.buildout V
     We have the best distribution that satisfies 'setuptools'.

Modified: zc.buildout/branches/gary-6/z3c.recipe.scripts_/src/z3c/recipe/scripts/README.txt
===================================================================
--- zc.buildout/branches/gary-6/z3c.recipe.scripts_/src/z3c/recipe/scripts/README.txt	2010-02-24 15:16:58 UTC (rev 109415)
+++ zc.buildout/branches/gary-6/z3c.recipe.scripts_/src/z3c/recipe/scripts/README.txt	2010-02-24 15:54:18 UTC (rev 109416)
@@ -325,7 +325,7 @@
     ... eggs = demoneeded
     ... ''' % globals())
 
-    >>> print do_build(python=py_path)
+    >>> print system(buildout)
     Creating directory '/sample-buildout/tmpeggs'.
     Uninstalling py.
     Installing eggs.
@@ -354,10 +354,11 @@
     ... allowed-eggs-from-site-packages =
     ... eggs = demoneeded
     ... ''' % globals())
-    >>> print do_build(python=py_path)
+    >>> print system(buildout)
     Creating directory '/sample-buildout/tmpeggs'.
     Uninstalling eggs.
     Installing eggs.
+    Couldn't find index page for 'demoneeded' (maybe misspelled?)
     Getting distribution for 'demoneeded'.
     While:
       Installing eggs.
@@ -458,6 +459,7 @@
 been created.
 
     >>> ls(sample_buildout, 'parts')
+    d  buildout
     d  demo
     d  python
 

Modified: zc.buildout/branches/gary-6/z3c.recipe.scripts_/src/z3c/recipe/scripts/tests.py
===================================================================
--- zc.buildout/branches/gary-6/z3c.recipe.scripts_/src/z3c/recipe/scripts/tests.py	2010-02-24 15:16:58 UTC (rev 109415)
+++ zc.buildout/branches/gary-6/z3c.recipe.scripts_/src/z3c/recipe/scripts/tests.py	2010-02-24 15:54:18 UTC (rev 109416)
@@ -267,7 +267,7 @@
     ... python = primed_python
     ... eggs = demoneeded
     ... ''' % globals())
-    >>> print do_build(python=py_path)
+    >>> print system(buildout)
     Installing eggs.
     Couldn't find index page for 'demoneeded' (maybe misspelled?)
     Getting distribution for 'demoneeded'.
@@ -297,7 +297,7 @@
     ... eggs = demoneeded
     ... ''' % globals())
 
-    >>> print do_build(python=py_path)
+    >>> print system(buildout)
     Installing eggs.
     <BLANKLINE>
 
@@ -315,7 +315,7 @@
     ... eggs = other
     ... ''' % globals())
 
-    >>> print do_build(python=py_path)
+    >>> print system(buildout)
     While:
       Installing.
       Getting section eggs.
@@ -357,7 +357,7 @@
     ... eggs = demoneeded
     ... ''' % globals())
 
-    >>> print do_build(python=py_path)
+    >>> print system(buildout)
     Installing eggs.
     <BLANKLINE>
 
@@ -383,7 +383,7 @@
     ... eggs = demoneeded
     ... ''' % globals())
 
-    >>> print do_build(python=py_path)
+    >>> print system(buildout)
     Uninstalling eggs.
     Installing eggs.
     <BLANKLINE>



More information about the checkins mailing list