[Checkins] SVN: zc.buildout/branches/gary-support-system-python/ status: tests pass. tests are pretty good for path ordering and for including/excluding site-packages. todo: need to update doc.txt; need to write tests for bootstrap additions; need to add ``search-path`` option with tests. We should be able to experiment with it now, though.
Gary Poster
gary.poster at canonical.com
Tue Jul 7 11:40:48 EDT 2009
Log message for revision 101717:
status: tests pass. tests are pretty good for path ordering and for including/excluding site-packages. todo: need to update doc.txt; need to write tests for bootstrap additions; need to add ``search-path`` option with tests. We should be able to experiment with it now, though.
Changed:
U zc.buildout/branches/gary-support-system-python/bootstrap/bootstrap.py
U zc.buildout/branches/gary-support-system-python/src/zc/buildout/easy_install.py
U zc.buildout/branches/gary-support-system-python/src/zc/buildout/easy_install.txt
U zc.buildout/branches/gary-support-system-python/src/zc/buildout/tests.py
U zc.buildout/branches/gary-support-system-python/src/zc/buildout/update.txt
U zc.buildout/branches/gary-support-system-python/zc.recipe.egg_/src/zc/recipe/egg/README.txt
-=-
Modified: zc.buildout/branches/gary-support-system-python/bootstrap/bootstrap.py
===================================================================
--- zc.buildout/branches/gary-support-system-python/bootstrap/bootstrap.py 2009-07-07 14:50:29 UTC (rev 101716)
+++ zc.buildout/branches/gary-support-system-python/bootstrap/bootstrap.py 2009-07-07 15:40:47 UTC (rev 101717)
@@ -61,7 +61,7 @@
while args:
val = args[0]
- elif val in configuration:
+ if val in configuration:
del args[0]
if not args or args[0].startswith('-'):
print "ERROR: %s requires an argument."
Modified: zc.buildout/branches/gary-support-system-python/src/zc/buildout/easy_install.py
===================================================================
--- zc.buildout/branches/gary-support-system-python/src/zc/buildout/easy_install.py 2009-07-07 14:50:29 UTC (rev 101716)
+++ zc.buildout/branches/gary-support-system-python/src/zc/buildout/easy_install.py 2009-07-07 15:40:47 UTC (rev 101717)
@@ -197,7 +197,7 @@
_use_dependency_links = True
_allow_picked_versions = True
_always_unzip = False
- _include_site_packages = False
+ _include_site_packages = True
def __init__(self,
dest=None,
@@ -974,7 +974,7 @@
include_site_packages=include_site_packages)
def get_path(working_set, executable, extra_paths=(),
- include_site_packages=False):
+ include_site_packages=True):
"""Given working set and path to executable, return value for sys.path.
Distribution locations from the working set come first in the list. Within
@@ -1008,7 +1008,11 @@
path.extend(extra_paths)
# now we add in all paths
if include_site_packages:
- path.extend(site_packages)
+ # err a bit on the side of cleanliness, avoiding dupes just to look
+ # pretty.
+ for location in site_packages:
+ if location not in path:
+ path.append(location)
path.extend(stdlib)
path = map(realpath, path)
return path
@@ -1019,7 +1023,7 @@
arguments='',
interpreter=None,
initialization='',
- include_site_packages=False,
+ include_site_packages=True,
relative_paths=False
):
path = get_path(
@@ -1074,7 +1078,7 @@
if relative_paths:
relative_paths = os.path.normcase(relative_paths)
sname = os.path.normcase(os.path.abspath(sname))
- spath = ',\n '.join(
+ spath = ',\n '.join(
[_relativitize(os.path.normcase(path_item), sname, relative_paths)
for path_item in path]
)
@@ -1082,7 +1086,7 @@
for i in range(_relative_depth(relative_paths, sname)):
rpsetup += "base = os.path.dirname(base)\n"
else:
- spath = repr(path)[1:-1].replace(', ', ',\n ')
+ spath = repr(path)[1:-1].replace(', ', ',\n ')
rpsetup = ''
return spath, rpsetup
@@ -1181,8 +1185,8 @@
%(relative_paths_setup)s
import sys
sys.path[:] = [
- %(path)s,
- ]
+ %(path)s,
+ ]
%(initialization)s
import %(module_name)s
@@ -1231,24 +1235,32 @@
_set_path = _interactive = True
_force_interactive = False
-_commands = []
-_args = None
+_command = None
+_args = sys.argv[1:]
-if len(sys.argv) > 1:
- import getopt
- _options, _args = getopt.getopt(sys.argv[1:], 'VSic:')
- for (_opt, _val) in _options:
- if _opt == '-i':
- _force_interactive = True
- elif _opt == '-c':
- _interactive = False
- _commands.append(_val)
- elif _opt == '-S':
- # We'll approximate this. It is mostly convenient for tests.
- _set_path = False
- elif _opt == '-V':
- print 'Python ' + sys.version.split()[0]
- _interactive = False
+while _args:
+ if _args[0].startswith('-'):
+ _arg = _args.pop(0)
+ for _ix, _opt in enumerate(_arg[1:]):
+ if _opt == 'i':
+ _force_interactive = True
+ elif _opt == 'c':
+ _interactive = False
+ _command = _args.pop(0) # Argument expected for the -c option
+ _args.insert(0, '-c')
+ break
+ elif _opt == 'S':
+ # We'll approximate this. It is mostly convenient for tests.
+ _set_path = False
+ elif _opt == 'V':
+ print 'Python ' + sys.version.split()[0]
+ _interactive = False
+ break
+ else:
+ continue
+ break
+ else:
+ break
if _set_path:
sys.path[:] = [
@@ -1256,12 +1268,12 @@
]
sys.path.insert(0, '.')
-for _command in _commands:
+sys.argv[:] = _args
+
+if _command:
exec _command
-
-if _args:
+elif _args:
_interactive = False
- sys.argv[:] = _args
execfile(sys.argv[0])
if _interactive or _force_interactive:
Modified: zc.buildout/branches/gary-support-system-python/src/zc/buildout/easy_install.txt
===================================================================
--- zc.buildout/branches/gary-support-system-python/src/zc/buildout/easy_install.txt 2009-07-07 14:50:29 UTC (rev 101716)
+++ zc.buildout/branches/gary-support-system-python/src/zc/buildout/easy_install.txt 2009-07-07 15:40:47 UTC (rev 101717)
@@ -93,6 +93,10 @@
A flag indicating whether Python's non-standard-library packages should
be available for finding dependencies. Defaults to true.
+ Paths outside of Python's standard library--or more precisely, those that
+ are not included when Python is started with the -S argument--are loosely
+ referred to as "site-packages" here.
+
relative_paths
Adjust egg paths so they are relative to the script path. This
allows scripts to work when scripts and eggs are moved, as long as
@@ -406,10 +410,12 @@
Dependencies in Site Packages
-----------------------------
-Setuptools includes packages found in the Python executable's system path
-(sys.path) when searching for dependencies. This can be disabled, so that
-a system Python can be used with buildout, cleaned of any packages installed
-by a user or system package manager.
+Paths outside of Python's standard library--or more precisely, those that are
+not included when Python is started with the -S argument--are loosely referred
+to as "site-packages" here. These site-packages are searched by default for
+distributions. This can be disabled, so that, for instance, a system Python
+can be used with buildout, cleaned of any packages installed by a user or
+system package manager.
The default behavior can be controlled and introspected using
zc.buildout.easy_install.include_site_packages.
@@ -419,14 +425,17 @@
Here's an example of using a Python executable that includes our dependencies.
+Our "primed_executable" has the "demoneeded," "other," and "setuptools"
+packages available. We'll simply be asking for "other" here.
+
>>> primed_executable = get_executable_with_site_packages()
>>> example_dest = tmpdir('site-packages-example-install')
>>> workingset = zc.buildout.easy_install.install(
- ... ['demo'], example_dest, links=[], executable=primed_executable,
+ ... ['other'], example_dest, links=[], executable=primed_executable,
... index=None)
>>> [dist.project_name for dist in workingset]
- ['demo', 'demoneeded']
+ ['other']
That worked fine. Let's try again with site packages not allowed. We'll
change the policy by changing the default. Notice that the function for
@@ -442,11 +451,12 @@
>>> rmdir(example_dest)
>>> example_dest = tmpdir('site-packages-example-install')
>>> workingset = zc.buildout.easy_install.install(
- ... ['demo'], example_dest, links=[], executable=primed_executable,
+ ... ['other'], example_dest, links=[], executable=primed_executable,
... index=None)
Traceback (most recent call last):
...
- MissingDistribution: Couldn't find a distribution for 'demo'.
+ MissingDistribution: Couldn't find a distribution for 'other'.
+ >>> zc.buildout.easy_install.clear_index_cache()
Now we'll reset the default.
@@ -456,12 +466,6 @@
>>> zc.buildout.easy_install.include_site_packages()
True
-We'll also reset a value expected by the rest of the test.
-
- >>> # get_executable_with_site_packages resets the Installer
- >>> zc.buildout.easy_install.prefer_final(True)
- False
-
Dependency links
----------------
@@ -648,10 +652,10 @@
<BLANKLINE>
import sys
sys.path[:] = [
- '/sample-install/demo-0.3-py2.4.egg',
- '/sample-install/demoneeded-1.1-py2.4.egg',
- ...
- ]
+ '/sample-install/demo-0.3-py2.4.egg',
+ '/sample-install/demoneeded-1.1-py2.4.egg',
+ ...
+ ]
<BLANKLINE>
import eggrecipedemo
<BLANKLINE>
@@ -687,10 +691,10 @@
<BLANKLINE>
import sys
sys.path[:] = [
- '/sample-install/demo-0.3-py2.4.egg',
- '/sample-install/demoneeded-1.1-py2.4.egg',
- ...
- ]
+ '/sample-install/demo-0.3-py2.4.egg',
+ '/sample-install/demoneeded-1.1-py2.4.egg',
+ ...
+ ]
<BLANKLINE>
import eggrecipedemo
<BLANKLINE>
@@ -735,39 +739,47 @@
_set_path = _interactive = True
_force_interactive = False
<BLANKLINE>
- _commands = []
- _args = None
+ _command = None
+ _args = sys.argv[1:]
<BLANKLINE>
- if len(sys.argv) > 1:
- import getopt
- _options, _args = getopt.getopt(sys.argv[1:], 'VSic:')
- for (_opt, _val) in _options:
- if _opt == '-i':
- _force_interactive = True
- elif _opt == '-c':
- _interactive = False
- _commands.append(_val)
- elif _opt == '-S':
- # We'll approximate this. It is mostly convenient for tests.
- _set_path = False
- elif _opt == '-V':
- print 'Python ' + sys.version.split()[0]
- _interactive = False
+ while _args:
+ if _args[0].startswith('-'):
+ _arg = _args.pop(0)
+ for _ix, _opt in enumerate(_arg[1:]):
+ if _opt == 'i':
+ _force_interactive = True
+ elif _opt == 'c':
+ _interactive = False
+ _command = _args.pop(0) # Argument expected for the -c option
+ _args.insert(0, '-c')
+ break
+ elif _opt == 'S':
+ # We'll approximate this. It is mostly convenient for tests.
+ _set_path = False
+ elif _opt == 'V':
+ print 'Python ' + sys.version.split()[0]
+ _interactive = False
+ break
+ else:
+ continue
+ break
+ else:
+ break
<BLANKLINE>
if _set_path:
sys.path[:] = [
'/sample-install/demo-0.3-pyN.N.egg',
- '/sample-install/demoneeded-1.1-pyN.N.egg',
- ...
+ '/sample-install/demoneeded-1.1-pyN.N.egg',
+ ...
]
sys.path.insert(0, '.')
<BLANKLINE>
- for _command in _commands:
+ sys.argv[:] = _args
+ <BLANKLINE>
+ if _command:
exec _command
- <BLANKLINE>
- if _args:
+ elif _args:
_interactive = False
- sys.argv[:] = _args
execfile(sys.argv[0])
<BLANKLINE>
if _interactive or _force_interactive:
@@ -823,6 +835,68 @@
if __name__ == '__main__':
eggrecipedemo.main()
+Ordering paths
+--------------
+
+We have already seen that we have a precise definition for a loose term:
+"site-packages". Paths outside of Python's standard library--or more
+precisely, those that are not included when Python is started with the -S
+argument--are loosely referred to as "site-packages" here.
+
+When generating scripts, paths that come from the site-packages are ordered
+after the other specific dependencies generated from the working set. This
+is so that directories such as "site-packages" that can contain multiple
+dependencies come after the more specific distributions found by setuptools,
+reducing the chance of the distributions being masked by the system folders.
+
+This is controlled by the ``get_path`` function, which is available for
+other script recipes to use.
+
+As a demonstration, we will have create a working set that has dependencies
+on "bigdemo" and "other". In our first case, we will use a clean Python
+without any of these dependencies installed.
+
+ >>> dest1 = tmpdir('path-install-1')
+ >>> ws1 = zc.buildout.easy_install.install(
+ ... ['other', 'bigdemo'], dest1,
+ ... links=[link_server], index=link_server+'index/')
+ >>> path1 = zc.buildout.easy_install.get_path(ws1, sys.executable)
+
+ >>> import pprint
+ >>> pprint.pprint(path1) # doctest: +ELLIPSIS
+ ['.../path-install-1/other-1.0-py...egg',
+ '.../path-install-1/bigdemo-0.1-py...egg',
+ '.../path-install-1/demo-0.3-py...egg',
+ '.../path-install-1/demoneeded-1.1-py...egg',
+ ...]
+
+We will now compare the results using a Python that has bigdemo's indirect
+dependency available, "demoneeded," and "other," but not "demo" or "bigdemo".
+
+ >>> dest2 = tmpdir('path-install-2')
+ >>> ws2 = zc.buildout.easy_install.install(
+ ... ['other', 'bigdemo'], dest2,
+ ... links=[link_server], index=link_server+'index/',
+ ... executable=primed_executable)
+ >>> path2 = zc.buildout.easy_install.get_path(ws2, primed_executable)
+ >>> pprint.pprint(path2) # doctest: +ELLIPSIS
+ ['.../path-install-2/bigdemo-0.1-py...egg',
+ '.../path-install-2/demo-0.3-py...egg',
+ '.../executable/eggs/other-1.0-py...egg',
+ '.../executable/eggs/demoneeded-1.1-py...egg',
+ '.../executable/eggs/setuptools-0.6c9-py...egg',
+ '.../executable/bin',
+ ...]
+ >>> zc.buildout.easy_install.clear_index_cache() # clean up
+
+Notice that the paths from the executable come after the ones for this
+buildout. This is most evident in the change of order for the "other" egg.
+
+In fact, this ordering is not important in this example, because the
+executable's paths all are individual packages; but if a path were a directory
+that shared many packages, like a classic "site-packages" directory, its shared
+packages would not mask those selected by the buildout.
+
Providing script arguments
--------------------------
@@ -862,10 +936,10 @@
#!/usr/local/bin/python2.4
import sys
sys.path[:] = [
- '/sample-install/demo-0.3-py2.4.egg',
- '/sample-install/demoneeded-1.1-py2.4.egg',
- ...
- ]
+ '/sample-install/demo-0.3-py2.4.egg',
+ '/sample-install/demoneeded-1.1-py2.4.egg',
+ ...
+ ]
<BLANKLINE>
import os
os.chdir("foo")
@@ -910,12 +984,12 @@
<BLANKLINE>
import sys
sys.path[:] = [
- join(base, 'eggs/demo-0.3-pyN.N.egg'),
- join(base, 'eggs/demoneeded-1.1-pyN.N.egg'),
- '/ba',
- join(base, 'bar'),
- ...
- ]
+ join(base, 'eggs/demo-0.3-pyN.N.egg'),
+ join(base, 'eggs/demoneeded-1.1-pyN.N.egg'),
+ '/ba',
+ join(base, 'bar'),
+ ...
+ ]
<BLANKLINE>
import eggrecipedemo
<BLANKLINE>
@@ -946,41 +1020,49 @@
_set_path = _interactive = True
_force_interactive = False
<BLANKLINE>
- _commands = []
- _args = None
+ _command = None
+ _args = sys.argv[1:]
<BLANKLINE>
- if len(sys.argv) > 1:
- import getopt
- _options, _args = getopt.getopt(sys.argv[1:], 'VSic:')
- for (_opt, _val) in _options:
- if _opt == '-i':
- _force_interactive = True
- elif _opt == '-c':
- _interactive = False
- _commands.append(_val)
- elif _opt == '-S':
- # We'll approximate this. It is mostly convenient for tests.
- _set_path = False
- elif _opt == '-V':
- print 'Python ' + sys.version.split()[0]
- _interactive = False
+ while _args:
+ if _args[0].startswith('-'):
+ _arg = _args.pop(0)
+ for _ix, _opt in enumerate(_arg[1:]):
+ if _opt == 'i':
+ _force_interactive = True
+ elif _opt == 'c':
+ _interactive = False
+ _command = _args.pop(0) # Argument expected for the -c option
+ _args.insert(0, '-c')
+ break
+ elif _opt == 'S':
+ # We'll approximate this. It is mostly convenient for tests.
+ _set_path = False
+ elif _opt == 'V':
+ print 'Python ' + sys.version.split()[0]
+ _interactive = False
+ break
+ else:
+ continue
+ break
+ else:
+ break
<BLANKLINE>
if _set_path:
sys.path[:] = [
join(base, 'eggs/demo-0.3-pyN.N.egg'),
- join(base, 'eggs/demoneeded-1.1-pyN.N.egg'),
- '/ba',
- join(base, 'bar'),
- ...
+ join(base, 'eggs/demoneeded-1.1-pyN.N.egg'),
+ '/ba',
+ join(base, 'bar'),
+ ...,
]
sys.path.insert(0, '.')
<BLANKLINE>
- for _command in _commands:
+ sys.argv[:] = _args
+ <BLANKLINE>
+ if _command:
exec _command
- <BLANKLINE>
- if _args:
+ elif _args:
_interactive = False
- sys.argv[:] = _args
execfile(sys.argv[0])
<BLANKLINE>
if _interactive or _force_interactive:
Modified: zc.buildout/branches/gary-support-system-python/src/zc/buildout/tests.py
===================================================================
--- zc.buildout/branches/gary-support-system-python/src/zc/buildout/tests.py 2009-07-07 14:50:29 UTC (rev 101716)
+++ zc.buildout/branches/gary-support-system-python/src/zc/buildout/tests.py 2009-07-07 15:40:47 UTC (rev 101717)
@@ -2344,16 +2344,19 @@
This is an isolated test of the include_site_packages functionality, passing
the argument directly to install, overriding a default.
+Our "primed_executable" has the "demoneeded," "other," and "setuptools"
+packages available. We'll simply be asking for "other" here.
+
>>> primed_executable = get_executable_with_site_packages()
>>> zc.buildout.easy_install.include_site_packages(False)
True
>>> example_dest = tmpdir('site-packages-example-install')
>>> workingset = zc.buildout.easy_install.install(
- ... ['demo'], example_dest, links=[], executable=primed_executable,
+ ... ['other'], example_dest, links=[], executable=primed_executable,
... index=None, include_site_packages=True)
>>> [dist.project_name for dist in workingset]
- ['demo', 'demoneeded']
+ ['other']
That worked fine. Let's try again with site packages not allowed (and
reversing the default).
@@ -2365,11 +2368,11 @@
>>> rmdir(example_dest)
>>> example_dest = tmpdir('site-packages-example-install')
>>> workingset = zc.buildout.easy_install.install(
- ... ['demo'], example_dest, links=[], executable=primed_executable,
+ ... ['other'], example_dest, links=[], executable=primed_executable,
... index=None, include_site_packages=False)
Traceback (most recent call last):
...
- MissingDistribution: Couldn't find a distribution for 'demo'.
+ MissingDistribution: Couldn't find a distribution for 'other'.
That's a failure, as expected.
@@ -2384,6 +2387,9 @@
not set find-links, but the eggs are still found because they are in the
executable's path.
+Our "primed_executable" has the "demoneeded," "other," and "setuptools"
+packages available. We'll simply be asking for "other" here.
+
>>> primed_executable = get_executable_with_site_packages()
>>> write('buildout.cfg',
... '''
@@ -2396,7 +2402,7 @@
... [eggs]
... recipe = zc.recipe.egg:eggs
... python = primed_python
- ... eggs = demo
+ ... eggs = other
... ''' % globals())
>>> print system(primed_executable+" "+buildout)
@@ -2419,17 +2425,17 @@
...
... [eggs]
... recipe = zc.recipe.egg:eggs
- ... eggs = demo
+ ... eggs = other
... ''' % globals())
>>> print system(primed_executable+" "+buildout)
Uninstalling eggs.
Installing eggs.
- Couldn't find index page for 'demo' (maybe misspelled?)
- Getting distribution for 'demo'.
+ Couldn't find index page for 'other' (maybe misspelled?)
+ Getting distribution for 'other'.
While:
Installing eggs.
- Getting distribution for 'demo'.
- Error: Couldn't find a distribution for 'demo'.
+ Getting distribution for 'other'.
+ Error: Couldn't find a distribution for 'other'.
<BLANKLINE>
We get an error if we specify anything but true or false:
@@ -2443,7 +2449,7 @@
...
... [eggs]
... recipe = zc.recipe.egg:eggs
- ... eggs = demo
+ ... eggs = other
... ''' % globals())
>>> print system(primed_executable+" "+buildout)
@@ -2779,11 +2785,14 @@
[buildout]
parts = interpreter
find-links = %(link_server)s
+ prefer-final = true
[interpreter]
recipe = zc.recipe.egg
interpreter = py
- eggs = demo
+ eggs = demoneeded
+ setuptools
+ other
''' % test.globs))
zc.buildout.buildout.Buildout(
'buildout.cfg',
Modified: zc.buildout/branches/gary-support-system-python/src/zc/buildout/update.txt
===================================================================
--- zc.buildout/branches/gary-support-system-python/src/zc/buildout/update.txt 2009-07-07 14:50:29 UTC (rev 101716)
+++ zc.buildout/branches/gary-support-system-python/src/zc/buildout/update.txt 2009-07-07 15:40:47 UTC (rev 101717)
@@ -80,14 +80,15 @@
Our buildout script has been updated to use the new eggs:
- >>> cat(sample_buildout, 'bin', 'buildout')
+ >>> cat(sample_buildout, 'bin', 'buildout') # doctest: +ELLIPSIS
#!/usr/local/bin/python2.4
<BLANKLINE>
import sys
- sys.path[0:0] = [
- '/sample-buildout/eggs/zc.buildout-99.99-py2.4.egg',
- '/sample-buildout/eggs/setuptools-99.99-py2.4.egg',
- ]
+ sys.path[:] = [
+ '/sample-buildout/eggs/zc.buildout-99.99-py2.4.egg',
+ '/sample-buildout/eggs/setuptools-99.99-py2.4.egg',
+ ...
+ ]
<BLANKLINE>
import zc.buildout.buildout
<BLANKLINE>
Modified: zc.buildout/branches/gary-support-system-python/zc.recipe.egg_/src/zc/recipe/egg/README.txt
===================================================================
--- zc.buildout/branches/gary-support-system-python/zc.recipe.egg_/src/zc/recipe/egg/README.txt 2009-07-07 14:50:29 UTC (rev 101716)
+++ zc.buildout/branches/gary-support-system-python/zc.recipe.egg_/src/zc/recipe/egg/README.txt 2009-07-07 15:40:47 UTC (rev 101717)
@@ -372,16 +372,18 @@
Let's look at the script that was generated:
- >>> cat(sample_buildout, 'bin', 'foo') # doctest: +NORMALIZE_WHITESPACE
+ >>> cat(sample_buildout, 'bin', 'foo')
+ ... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
#!/usr/local/bin/python2.4
<BLANKLINE>
import sys
- sys.path[0:0] = [
- '/sample-buildout/eggs/demo-0.4c1-py2.4.egg',
- '/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg',
- '/foo/bar',
- '/sample-buildout/spam',
- ]
+ sys.path[:] = [
+ '/sample-buildout/eggs/demo-0.4c1-py2.4.egg',
+ '/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg',
+ '/foo/bar',
+ '/sample-buildout/spam',
+ ...
+ ]
<BLANKLINE>
import eggrecipedemo
<BLANKLINE>
@@ -419,7 +421,8 @@
Let's look at the script that was generated:
- >>> cat(sample_buildout, 'bin', 'foo') # doctest: +NORMALIZE_WHITESPACE
+ >>> cat(sample_buildout, 'bin', 'foo')
+ ... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
#!/usr/local/bin/python2.4
<BLANKLINE>
import os
@@ -429,12 +432,13 @@
base = os.path.dirname(base)
<BLANKLINE>
import sys
- sys.path[0:0] = [
- join(base, 'eggs/demo-0.4c1-pyN.N.egg'),
- join(base, 'eggs/demoneeded-1.2c1-pyN.N.egg'),
- '/foo/bar',
- join(base, 'spam'),
- ]
+ sys.path[:] = [
+ join(base, 'eggs/demo-0.4c1-pyN.N.egg'),
+ join(base, 'eggs/demoneeded-1.2c1-pyN.N.egg'),
+ '/foo/bar',
+ join(base, 'spam'),
+ ...
+ ]
<BLANKLINE>
import eggrecipedemo
<BLANKLINE>
@@ -466,7 +470,8 @@
Installing demo.
Generated script '/sample-buildout/bin/foo'.
- >>> cat(sample_buildout, 'bin', 'foo') # doctest: +NORMALIZE_WHITESPACE
+ >>> cat(sample_buildout, 'bin', 'foo')
+ ... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
#!/usr/local/bin/python2.4
<BLANKLINE>
import os
@@ -476,12 +481,13 @@
base = os.path.dirname(base)
<BLANKLINE>
import sys
- sys.path[0:0] = [
- join(base, 'eggs/demo-0.4c1-pyN.N.egg'),
- join(base, 'eggs/demoneeded-1.2c1-pyN.N.egg'),
- '/foo/bar',
- join(base, 'spam'),
- ]
+ sys.path[:] = [
+ join(base, 'eggs/demo-0.4c1-pyN.N.egg'),
+ join(base, 'eggs/demoneeded-1.2c1-pyN.N.egg'),
+ '/foo/bar',
+ join(base, 'spam'),
+ ...
+ ]
<BLANKLINE>
import eggrecipedemo
<BLANKLINE>
@@ -519,16 +525,18 @@
Installing demo.
Generated script '/sample-buildout/bin/foo'.
- >>> cat(sample_buildout, 'bin', 'foo') # doctest: +NORMALIZE_WHITESPACE
+ >>> cat(sample_buildout, 'bin', 'foo')
+ ... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
#!/usr/local/bin/python2.4
<BLANKLINE>
import sys
- sys.path[0:0] = [
- '/sample-buildout/eggs/demo-0.4c1-py2.4.egg',
- '/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg',
- '/foo/bar',
- '/sample-buildout/spam',
- ]
+ sys.path[:] = [
+ '/sample-buildout/eggs/demo-0.4c1-py2.4.egg',
+ '/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg',
+ '/foo/bar',
+ '/sample-buildout/spam',
+ ...
+ ]
<BLANKLINE>
a = (1, 2
3, 4)
@@ -577,16 +585,17 @@
- demo
- other
- >>> cat(sample_buildout, 'bin', 'other')
+ >>> cat(sample_buildout, 'bin', 'other') # doctest: +ELLIPSIS
#!/usr/local/bin/python2.4
<BLANKLINE>
import sys
- sys.path[0:0] = [
- '/sample-buildout/eggs/demo-0.4c1-py2.4.egg',
- '/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg',
- '/foo/bar',
- '/sample-buildout/spam',
- ]
+ sys.path[:] = [
+ '/sample-buildout/eggs/demo-0.4c1-py2.4.egg',
+ '/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg',
+ '/foo/bar',
+ '/sample-buildout/spam',
+ ...
+ ]
<BLANKLINE>
import foo.bar
<BLANKLINE>
More information about the Checkins
mailing list