[Checkins] SVN: zc.buildout/branches/gary-6/ make tests pass in Windows.

Gary Poster gary.poster at canonical.com
Tue Feb 23 14:02:38 EST 2010


Log message for revision 109376:
  make tests pass in Windows.

Changed:
  U   zc.buildout/branches/gary-6/dev.py
  U   zc.buildout/branches/gary-6/src/zc/buildout/easy_install.py
  U   zc.buildout/branches/gary-6/src/zc/buildout/easy_install.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/dev.py
===================================================================
--- zc.buildout/branches/gary-6/dev.py	2010-02-23 18:33:08 UTC (rev 109375)
+++ zc.buildout/branches/gary-6/dev.py	2010-02-23 19:02:38 UTC (rev 109376)
@@ -40,10 +40,12 @@
 
     import pkg_resources
 
+env = os.environ.copy() # Windows needs yet-to-be-determined values from this.
+env['PYTHONPATH'] = os.path.dirname(pkg_resources.__file__)
 subprocess.Popen(
     [sys.executable] +
     ['setup.py', '-q', 'develop', '-m', '-x', '-d', 'develop-eggs'],
-    env = {'PYTHONPATH': os.path.dirname(pkg_resources.__file__)}).wait()
+    env=env).wait()
 
 pkg_resources.working_set.add_entry('src')
 

Modified: zc.buildout/branches/gary-6/src/zc/buildout/easy_install.py
===================================================================
--- zc.buildout/branches/gary-6/src/zc/buildout/easy_install.py	2010-02-23 18:33:08 UTC (rev 109375)
+++ zc.buildout/branches/gary-6/src/zc/buildout/easy_install.py	2010-02-23 19:02:38 UTC (rev 109376)
@@ -197,7 +197,7 @@
 
 if is_win32:
     # work around spawn lamosity on windows
-    # XXX need safe quoting (see the subproces.list2cmdline) and test
+    # XXX need safe quoting (see the subprocess.list2cmdline) and test
     def _safe_arg(arg):
         return '"%s"' % arg
 else:

Modified: zc.buildout/branches/gary-6/src/zc/buildout/easy_install.txt
===================================================================
--- zc.buildout/branches/gary-6/src/zc/buildout/easy_install.txt	2010-02-23 18:33:08 UTC (rev 109375)
+++ zc.buildout/branches/gary-6/src/zc/buildout/easy_install.txt	2010-02-23 19:02:38 UTC (rev 109376)
@@ -998,7 +998,7 @@
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 The newer function for creating scripts is ``sitepackage_safe_scripts``.
- It has the same basic functionality as the ``scripts`` function: it can
+It has the same basic functionality as the ``scripts`` function: it can
 create scripts to run arbitrary entry points, and to run a Python
 interpreter.  The following are the differences from a user's
 perspective.

Modified: zc.buildout/branches/gary-6/src/zc/buildout/testing.py
===================================================================
--- zc.buildout/branches/gary-6/src/zc/buildout/testing.py	2010-02-23 18:33:08 UTC (rev 109375)
+++ zc.buildout/branches/gary-6/src/zc/buildout/testing.py	2010-02-23 19:02:38 UTC (rev 109376)
@@ -374,6 +374,19 @@
         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,
@@ -384,6 +397,7 @@
         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))),
@@ -391,7 +405,7 @@
         sdist = sdist,
         bdist_egg = bdist_egg,
         start_server = start_server,
-        buildout = os.path.join(sample, 'bin', 'buildout'),
+        buildout = 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-23 18:33:08 UTC (rev 109375)
+++ zc.buildout/branches/gary-6/src/zc/buildout/tests.py	2010-02-23 19:02:38 UTC (rev 109376)
@@ -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 system(py_path+" "+buildout+" -v")
+    >>> print do_build(python=py_path, args=['-v'])
     Installing 'zc.buildout', 'setuptools'.
     We have a develop egg: zc.buildout V
     We have the best distribution that satisfies 'setuptools'.
@@ -3367,7 +3367,8 @@
         here = os.getcwd()
         os.chdir(os.path.dirname(dist.location))
         assert os.spawnle(
-            os.P_WAIT, sys.executable, zc.buildout.easy_install._safe_arg (sys.executable),
+            os.P_WAIT, sys.executable,
+            zc.buildout.easy_install._safe_arg(sys.executable),
             os.path.join(os.path.dirname(dist.location), 'setup.py'),
             '-q', 'bdist_egg', '-d', eggs,
             dict(os.environ,

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-23 18:33:08 UTC (rev 109375)
+++ zc.buildout/branches/gary-6/z3c.recipe.scripts_/src/z3c/recipe/scripts/README.txt	2010-02-23 19:02:38 UTC (rev 109376)
@@ -325,7 +325,7 @@
     ... eggs = demoneeded
     ... ''' % globals())
 
-    >>> print system(py_path+" "+buildout)
+    >>> print do_build(python=py_path)
     Creating directory '/sample-buildout/tmpeggs'.
     Uninstalling py.
     Installing eggs.
@@ -354,7 +354,7 @@
     ... allowed-eggs-from-site-packages =
     ... eggs = demoneeded
     ... ''' % globals())
-    >>> print system(py_path+" "+buildout)
+    >>> print do_build(python=py_path)
     Creating directory '/sample-buildout/tmpeggs'.
     Uninstalling eggs.
     Installing eggs.

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-23 18:33:08 UTC (rev 109375)
+++ zc.buildout/branches/gary-6/z3c.recipe.scripts_/src/z3c/recipe/scripts/tests.py	2010-02-23 19:02:38 UTC (rev 109376)
@@ -267,7 +267,7 @@
     ... python = primed_python
     ... eggs = demoneeded
     ... ''' % globals())
-    >>> print system(py_path+" "+buildout)
+    >>> print do_build(python=py_path)
     Installing eggs.
     Couldn't find index page for 'demoneeded' (maybe misspelled?)
     Getting distribution for 'demoneeded'.
@@ -297,7 +297,7 @@
     ... eggs = demoneeded
     ... ''' % globals())
 
-    >>> print system(py_path+" "+buildout)
+    >>> print do_build(python=py_path)
     Installing eggs.
     <BLANKLINE>
 
@@ -315,7 +315,7 @@
     ... eggs = other
     ... ''' % globals())
 
-    >>> print system(py_path+" "+buildout)
+    >>> print do_build(python=py_path)
     While:
       Installing.
       Getting section eggs.
@@ -357,7 +357,7 @@
     ... eggs = demoneeded
     ... ''' % globals())
 
-    >>> print system(py_path+" "+buildout)
+    >>> print do_build(python=py_path)
     Installing eggs.
     <BLANKLINE>
 
@@ -383,7 +383,7 @@
     ... eggs = demoneeded
     ... ''' % globals())
 
-    >>> print system(py_path+" "+buildout)
+    >>> print do_build(python=py_path)
     Uninstalling eggs.
     Installing eggs.
     <BLANKLINE>



More information about the checkins mailing list