[Checkins] SVN: zc.buildout/branches/python-3-2/ checkpoint

Jim Fulton jim at zope.com
Sat Mar 19 13:39:44 EDT 2011


Log message for revision 121045:
  checkpoint

Changed:
  U   zc.buildout/branches/python-3-2/bootstrap/bootstrap.py
  U   zc.buildout/branches/python-3-2/src/zc/buildout/bootstrap.txt
  U   zc.buildout/branches/python-3-2/src/zc/buildout/buildout.py
  U   zc.buildout/branches/python-3-2/src/zc/buildout/easy_install.py
  U   zc.buildout/branches/python-3-2/src/zc/buildout/rmtree.py
  U   zc.buildout/branches/python-3-2/src/zc/buildout/tests.py
  U   zc.buildout/branches/python-3-2/src/zc/buildout/virtualenv.txt
  U   zc.buildout/branches/python-3-2/z3c.recipe.scripts_/src/z3c/recipe/scripts/tests.py
  U   zc.buildout/branches/python-3-2/zc.recipe.egg_/src/zc/recipe/egg/README.txt
  U   zc.buildout/branches/python-3-2/zc.recipe.egg_/src/zc/recipe/egg/api.txt
  U   zc.buildout/branches/python-3-2/zc.recipe.egg_/src/zc/recipe/egg/custom.txt

-=-
Modified: zc.buildout/branches/python-3-2/bootstrap/bootstrap.py
===================================================================
--- zc.buildout/branches/python-3-2/bootstrap/bootstrap.py	2011-03-18 18:33:08 UTC (rev 121044)
+++ zc.buildout/branches/python-3-2/bootstrap/bootstrap.py	2011-03-19 17:39:43 UTC (rev 121045)
@@ -165,7 +165,7 @@
         raise ImportError
 except ImportError:
     ez_code = urllib.request.urlopen(
-        options.setup_source).read().replace('\r\n', '\n')
+        options.setup_source).read().replace('\r\n'.encode(), '\n'.encode())
     ez = {}
     exec(ez_code, ez)
     setup_args = dict(to_dir=eggs_dir, download_delay=0)

Modified: zc.buildout/branches/python-3-2/src/zc/buildout/bootstrap.txt
===================================================================
--- zc.buildout/branches/python-3-2/src/zc/buildout/bootstrap.txt	2011-03-18 18:33:08 UTC (rev 121044)
+++ zc.buildout/branches/python-3-2/src/zc/buildout/bootstrap.txt	2011-03-19 17:39:43 UTC (rev 121045)
@@ -20,7 +20,7 @@
     ... parts =
     ... ''')
     >>> write('bootstrap.py', open(bootstrap_py).read())
-    >>> print('X'); run(
+    >>> print('XX'); run(
     ...     zc.buildout.easy_install._safe_arg(sys.executable)+' '+
     ...     'bootstrap.py'); print('X') # doctest: +ELLIPSIS
     X...
@@ -265,9 +265,7 @@
 Last, the -c option needs to work on bootstrap.py::
 
     >>> conf_file = os.path.join(sample_buildout, 'other.cfg')
-    >>> f = open(conf_file, 'w')
-    >>> f.write('[buildout]\nparts=\n\n')
-    >>> f.close()
+    >>> write(conf_file, '[buildout]\nparts=\n\n')
     >>> print('XX'); run(
     ...     zc.buildout.easy_install._safe_arg(sys.executable)+' '+
     ...     'bootstrap.py -c %s --distribute' % conf_file) # doctest: +ELLIPSIS

Modified: zc.buildout/branches/python-3-2/src/zc/buildout/buildout.py
===================================================================
--- zc.buildout/branches/python-3-2/src/zc/buildout/buildout.py	2011-03-18 18:33:08 UTC (rev 121044)
+++ zc.buildout/branches/python-3-2/src/zc/buildout/buildout.py	2011-03-19 17:39:43 UTC (rev 121045)
@@ -84,7 +84,7 @@
     return data
 
 def _print_annotate(data):
-    sections = list(data.keys())
+    sections = list(data)
     sections.sort()
     print()
     print("Annotated sections")
@@ -92,7 +92,7 @@
     for section in sections:
         print()
         print('[%s]' % section)
-        keys = list(data[section].keys())
+        keys = list(data[section])
         keys.sort()
         for key in keys:
             value, notes = data[section][key]
@@ -629,7 +629,7 @@
         installed = self['buildout']['installed']
         f = open(installed, 'a')
         f.write('\n[buildout]\n')
-        for option, value in list(buildout_options.items()):
+        for option, value in buildout_options.items():
             _save_option(option, value, f)
         f.close()
 
@@ -1060,7 +1060,7 @@
         raise NotImplementedError('__delitem__')
 
     def keys(self):
-        return list(self._raw.keys())
+        return list(self._raw)
 
     def __iter__(self):
         return iter(self._raw)
@@ -1124,7 +1124,7 @@
             self._raw = self._do_extend_raw(name, self._raw, [])
 
         # force substitutions
-        for k, v in list(self._raw.items()):
+        for k, v in self._raw.items():
             if '${' in v:
                 self._dosub(k, v)
 

Modified: zc.buildout/branches/python-3-2/src/zc/buildout/easy_install.py
===================================================================
--- zc.buildout/branches/python-3-2/src/zc/buildout/easy_install.py	2011-03-18 18:33:08 UTC (rev 121044)
+++ zc.buildout/branches/python-3-2/src/zc/buildout/easy_install.py	2011-03-19 17:39:43 UTC (rev 121045)
@@ -304,7 +304,7 @@
 p = sys.path[:];\
 import site;\
 sys.path[:] = p;\
-[sys.modules.pop(k) for k, v in sys.modules.items()\
+[sys.modules.pop(k) for k, v in list(sys.modules.items())\
  if hasattr(v, '__path__') and len(v.__path__)==1 and\
  not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))];'''
 _easy_install_cmd = (
@@ -1848,7 +1848,7 @@
         self.err, self.ws = err, ws
 
     def __str__(self):
-        existing_dist, req = self.err
+        existing_dist, req = self.err.args
         result = ["There is a version conflict.",
                   "We already have: %s" % existing_dist,
                   ]

Modified: zc.buildout/branches/python-3-2/src/zc/buildout/rmtree.py
===================================================================
--- zc.buildout/branches/python-3-2/src/zc/buildout/rmtree.py	2011-03-18 18:33:08 UTC (rev 121044)
+++ zc.buildout/branches/python-3-2/src/zc/buildout/rmtree.py	2011-03-19 17:39:43 UTC (rev 121045)
@@ -38,11 +38,11 @@
     Now create a file ...
 
     >>> foo = os.path.join (d, 'foo')
-    >>> open (foo, 'w').write ('huhu')
+    >>> write(foo, 'hulu')
 
     and make it unwriteable
 
-    >>> os.chmod (foo, 0400)
+    >>> os.chmod (foo, int('0400', 8))
 
     rmtree should be able to remove it:
 
@@ -54,7 +54,7 @@
     0
     """
     def retry_writeable (func, path, exc):
-        os.chmod (path, 0o600)
+        os.chmod (path, int('0600', 8))
         func (path)
 
     shutil.rmtree (path, onerror = retry_writeable)

Modified: zc.buildout/branches/python-3-2/src/zc/buildout/tests.py
===================================================================
--- zc.buildout/branches/python-3-2/src/zc/buildout/tests.py	2011-03-18 18:33:08 UTC (rev 121044)
+++ zc.buildout/branches/python-3-2/src/zc/buildout/tests.py	2011-03-19 17:39:43 UTC (rev 121045)
@@ -1164,7 +1164,6 @@
     >>> ls('recipe')
     l  another-file
     -  foo.py
-    -  foo.pyc
     d  recipe.egg-info
     -  setup.py
     -  some-file
@@ -2585,8 +2584,8 @@
     ...     p = subprocess.Popen(s, stdin=subprocess.PIPE,
     ...                 stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
     ...     p.stdin.close()
-    ...     print p.stdout.read()
-    ...     print 'Exit:', bool(p.wait())
+    ...     print(p.stdout.read())
+    ...     print('Exit: %s' % bool(p.wait()))
 
     >>> call(buildout)
     <BLANKLINE>
@@ -2828,16 +2827,13 @@
 
 def read_find_links_to_load_extensions():
     """
-We'll create a wacky buildout extension that is just another name for http:
+We'll create a wacky buildout extension that just says how wackit it is:
 
     >>> src = tmpdir('src')
     >>> write(src, 'wacky_handler.py',
     ... '''
-    ... import urllib2
-    ... class Wacky(urllib2.HTTPHandler):
-    ...     wacky_open = urllib2.HTTPHandler.http_open
     ... def install(buildout=None):
-    ...     urllib2.install_opener(urllib2.build_opener(Wacky))
+    ...     print("I'm so wacky,")
     ... ''')
     >>> write(src, 'setup.py',
     ... '''
@@ -2871,7 +2867,7 @@
     ... ''' % globals())
 
 When we run the buildout. it will load the extension from the dist
-directory and then use the wacky extension to load the demo package
+directory:
 
     >>> run(buildout)
     Getting distribution for 'wackyextension'.
@@ -3350,8 +3346,8 @@
     >>> write('t.py',
     ... '''
     ... import eggrecipedemo, eggrecipedemoneeded
-    ... print(eggrecipedemo.main.func_code.co_filename)
-    ... print(eggrecipedemoneeded.f.func_code.co_filename)
+    ... print(eggrecipedemo.__file__)
+    ... print(eggrecipedemoneeded.__file__)
     ... ''')
 
     >>> run(join('bin', 'py')+ ' t.py')
@@ -3451,12 +3447,14 @@
     """
     There was a bug that caused extras in requirements to be lost.
 
-    >>> open('setup.py', 'w').write('''
+    >>> f = open('setup.py', 'w')
+    >>> _ = f.write('''
     ... from setuptools import setup
     ... setup(name='extraversiondemo', version='1.0',
     ...       url='x', author='x', author_email='x',
     ...       extras_require=dict(foo=['demo']), py_modules=['t'])
     ... ''')
+    >>> f.close()
     >>> open('README', 'w').close()
     >>> open('t.py', 'w').close()
 
@@ -4120,6 +4118,7 @@
                 (re.compile('distribute'), 'setuptools'),
                 # Distribute unzips eggs by default.
                 (re.compile('\-  demoneeded'), 'd  demoneeded'),
+                (re.compile(r'^.*\.py[co]\n'), ''),
                 ]),
             ),
         zc.buildout.rmtree.test_suite(),

Modified: zc.buildout/branches/python-3-2/src/zc/buildout/virtualenv.txt
===================================================================
--- zc.buildout/branches/python-3-2/src/zc/buildout/virtualenv.txt	2011-03-18 18:33:08 UTC (rev 121044)
+++ zc.buildout/branches/python-3-2/src/zc/buildout/virtualenv.txt	2011-03-19 17:39:43 UTC (rev 121045)
@@ -73,17 +73,16 @@
     ... argv = new_argv
     ... '''
     >>> for line in py_lines:
-    ...     py_file.write(line)
+    ...     _ = py_file.write(line)
     ...     if line.startswith('environ = os.environ.copy()'):
-    ...         py_file.write(extra)
+    ...         _ = py_file.write(extra)
     ...         print('Rewritten.')
     ...
     Rewritten.
     >>> py_file.close()
     >>> sitecustomize_path = join(os.path.dirname(site_packages_path),
     ...                           'parts', 'py', 'sitecustomize.py')
-    >>> sitecustomize_file = open(sitecustomize_path, 'a')
-    >>> sitecustomize_file.write('''
+    >>> write(sitecustomize_path, '''
     ... import os, sys
     ... sys.executable = %r
     ... if 'BROKEN_DASH_S' in os.environ:
@@ -113,11 +112,10 @@
     ...
     ...     sys.meta_path.append(ImportHook)
     ... ''' % (py_path,))
-    >>> sitecustomize_file.close()
-    >>> print(call_py(
+
+    >>> print_(call_py(
     ...     _safe_arg(py_path),
     ...     "import ConfigParser"))
-    <BLANKLINE>
 
     >>> print('X'); print(call_py(
     ...     _safe_arg(py_path),

Modified: zc.buildout/branches/python-3-2/z3c.recipe.scripts_/src/z3c/recipe/scripts/tests.py
===================================================================
--- zc.buildout/branches/python-3-2/z3c.recipe.scripts_/src/z3c/recipe/scripts/tests.py	2011-03-18 18:33:08 UTC (rev 121044)
+++ zc.buildout/branches/python-3-2/z3c.recipe.scripts_/src/z3c/recipe/scripts/tests.py	2011-03-19 17:39:43 UTC (rev 121045)
@@ -370,9 +370,8 @@
     ... eggs = demoneeded
     ... ''' % globals())
 
-    >>> print system(buildout)
+    >>> run(buildout)
     Installing eggs.
-    <BLANKLINE>
 
 Specifying the egg exactly will work as well.  This shows we correctly
 parse a multi-line value.
@@ -396,10 +395,9 @@
     ... eggs = demoneeded
     ... ''' % globals())
 
-    >>> print system(buildout)
+    >>> run(buildout)
     Uninstalling eggs.
     Installing eggs.
-    <BLANKLINE>
 
 It will also work if we use a glob ("*" or "?").  (We won't show that here
 because we already tested it in

Modified: zc.buildout/branches/python-3-2/zc.recipe.egg_/src/zc/recipe/egg/README.txt
===================================================================
--- zc.buildout/branches/python-3-2/zc.recipe.egg_/src/zc/recipe/egg/README.txt	2011-03-18 18:33:08 UTC (rev 121044)
+++ zc.buildout/branches/python-3-2/zc.recipe.egg_/src/zc/recipe/egg/README.txt	2011-03-19 17:39:43 UTC (rev 121045)
@@ -67,7 +67,7 @@
 Let's run the buildout:
 
     >>> import os
-    >>> print system(buildout),
+    >>> run(buildout)
     Installing demo.
     Getting distribution for 'demo<0.3'.
     Got demo 0.2.
@@ -111,7 +111,7 @@
     ... index = %(server)s/index
     ... """ % dict(server=link_server))
 
-    >>> print system(buildout),
+    >>> run(buildout)
     Uninstalling demo.
     Installing demo.
     Generated script '/sample-buildout/bin/demo'.
@@ -193,7 +193,7 @@
 specification. We were able to do this because the scripts recipe is
 the default entry point for the zc.recipe.egg egg.
 
-   >>> print system(buildout),
+   >>> run(buildout)
    Uninstalling demo.
    Installing demo.
    Generated script '/sample-buildout/bin/demo'.
@@ -210,7 +210,7 @@
 
 If we run the demo script, it prints out some minimal data:
 
-    >>> print system(join(sample_buildout, 'bin', 'demo')),
+    >>> run(join(sample_buildout, 'bin', 'demo'))
     2 2
 
 The value it prints out happens to be some values defined in the
@@ -219,7 +219,7 @@
 We can also run the py-demo script.  Here we'll just print out
 the bits if the path added to reflect the eggs:
 
-    >>> print system(join(sample_buildout, 'bin', 'py-demo'),
+    >>> run(join(sample_buildout, 'bin', 'py-demo')
     ... """import os, sys
     ... for p in sys.path:
     ...     if 'demo' in p:
@@ -251,7 +251,7 @@
 
 and run the buildout in non-newest mode:
 
-    >>> print system(buildout+' -N'),
+    >>> run(buildout+' -N')
     Uninstalling demo.
     Installing demo.
     Generated script '/sample-buildout/bin/demo'.
@@ -262,7 +262,7 @@
 
 We'll also run the buildout in off-line mode:
 
-    >>> print system(buildout+' -o'),
+    >>> run(buildout+' -o')
     Updating demo.
 
 We didn't get an update for demo:
@@ -276,7 +276,7 @@
 If we run the buildout on the default online and newest modes,
 we'll get an update for demo:
 
-    >>> print system(buildout),
+    >>> run(buildout)
     Updating demo.
     Getting distribution for 'demo'.
     Got demo 0.4c1.
@@ -293,7 +293,7 @@
 
 The script is updated too:
 
-    >>> print system(join(sample_buildout, 'bin', 'demo')),
+    >>> run(join(sample_buildout, 'bin', 'demo'))
     4 2
 
 Controlling script generation
@@ -316,7 +316,7 @@
     ... """ % dict(server=link_server))
 
 
-    >>> print system(buildout),
+    >>> run(buildout)
     Uninstalling demo.
     Installing demo.
 
@@ -337,7 +337,7 @@
     ... scripts = demo=foo
     ... """ % dict(server=link_server))
 
-    >>> print system(buildout),
+    >>> run(buildout)
     Uninstalling demo.
     Installing demo.
     Generated script '/sample-buildout/bin/foo'.
@@ -367,7 +367,7 @@
     ...    ${buildout:directory}/spam
     ... """ % dict(server=link_server))
 
-    >>> print system(buildout),
+    >>> run(buildout)
     Uninstalling demo.
     Installing demo.
     Generated script '/sample-buildout/bin/foo'.
@@ -414,7 +414,7 @@
     ...    ${buildout:directory}/spam
     ... """ % dict(server=link_server))
 
-    >>> print system(buildout),
+    >>> run(buildout)
     Uninstalling demo.
     Installing demo.
     Generated script '/sample-buildout/bin/foo'.
@@ -463,7 +463,7 @@
     ...    ${buildout:directory}/spam
     ... """ % dict(server=link_server))
 
-    >>> print system(buildout),
+    >>> run(buildout)
     Uninstalling demo.
     Installing demo.
     Generated script '/sample-buildout/bin/foo'.
@@ -516,7 +516,7 @@
     ... arguments = a, 2
     ... """ % dict(server=link_server))
 
-    >>> print system(buildout),
+    >>> run(buildout)
     Uninstalling demo.
     Installing demo.
     Generated script '/sample-buildout/bin/foo'.
@@ -566,7 +566,7 @@
     ... entry-points = alt=eggrecipedemo:alt other=foo.bar:a.b.c
     ... """ % dict(server=link_server))
 
-    >>> print system(buildout),
+    >>> run(buildout)
     Uninstalling demo.
     Installing demo.
     Generated script '/sample-buildout/bin/demo'.
@@ -613,7 +613,7 @@
     ... index = %(server)s/index
     ... dependent-scripts = true
     ... """ % dict(server=link_server))
-    >>> print system(buildout+' -N'),
+    >>> run(buildout+' -N')
     Uninstalling demo.
     Installing bigdemo.
     Getting distribution for 'bigdemo'.
@@ -638,7 +638,7 @@
     ... scripts = demo=foo
     ... """ % dict(server=link_server))
 
-    >>> print system(buildout),
+    >>> run(buildout)
     Uninstalling bigdemo.
     Installing demo.
     Generated script '/sample-buildout/bin/foo'.

Modified: zc.buildout/branches/python-3-2/zc.recipe.egg_/src/zc/recipe/egg/api.txt
===================================================================
--- zc.buildout/branches/python-3-2/zc.recipe.egg_/src/zc/recipe/egg/api.txt	2011-03-18 18:33:08 UTC (rev 121044)
+++ zc.buildout/branches/python-3-2/zc.recipe.egg_/src/zc/recipe/egg/api.txt	2011-03-19 17:39:43 UTC (rev 121045)
@@ -81,7 +81,7 @@
     >>> import os
     >>> os.chdir(sample_buildout)
     >>> buildout = os.path.join(sample_buildout, 'bin', 'buildout')
-    >>> print system(buildout + ' -q'),
+    >>> run(buildout + ' -q')
     Part: sample-part
     Egg requirements:
     demo<0.3
@@ -141,7 +141,7 @@
 Then we'll see that reflected in the extra_paths attribute in the egg
 recipe instance:
 
-    >>> print system(buildout + ' -q'),
+    >>> run(buildout + ' -q')
     Part: sample-part
     Egg requirements:
     demo<0.3

Modified: zc.buildout/branches/python-3-2/zc.recipe.egg_/src/zc/recipe/egg/custom.txt
===================================================================
--- zc.buildout/branches/python-3-2/zc.recipe.egg_/src/zc/recipe/egg/custom.txt	2011-03-18 18:33:08 UTC (rev 121044)
+++ zc.buildout/branches/python-3-2/zc.recipe.egg_/src/zc/recipe/egg/custom.txt	2011-03-19 17:39:43 UTC (rev 121045)
@@ -137,7 +137,7 @@
     ...
     ... """ % dict(server=link_server))
 
-    >>> print system(buildout),
+    >>> run(buildout)
     Installing extdemo.
     zip_safe flag not set; analyzing archive contents...
 
@@ -194,7 +194,7 @@
     ... entry-points = demo=demo:main
     ... """ % dict(server=link_server))
 
-    >>> print system(buildout),
+    >>> run(buildout)
     Develop: '/sample-buildout/demo'
     Updating extdemo.
     Installing demo.



More information about the checkins mailing list