[Checkins] SVN: zc.buildout/branches/gary-support-system-python/ clean up on basis of review by flacoste

Gary Poster gary.poster at canonical.com
Tue Aug 11 11:39:31 EDT 2009


Log message for revision 102678:
  clean up on basis of review by flacoste

Changed:
  U   zc.buildout/branches/gary-support-system-python/CHANGES.txt
  U   zc.buildout/branches/gary-support-system-python/src/zc/buildout/buildout.txt
  U   zc.buildout/branches/gary-support-system-python/src/zc/buildout/tests.py

-=-
Modified: zc.buildout/branches/gary-support-system-python/CHANGES.txt
===================================================================
--- zc.buildout/branches/gary-support-system-python/CHANGES.txt	2009-08-11 14:14:59 UTC (rev 102677)
+++ zc.buildout/branches/gary-support-system-python/CHANGES.txt	2009-08-11 15:39:30 UTC (rev 102678)
@@ -25,6 +25,22 @@
     a whitelist of project names of eggs that are allowed to come from
     your Python's site-packages.  This lets you more tightly control your use
     of site-packages.
+    
+    This option interacts with the ``include-site-packages`` option in the
+    following ways.
+    
+    If ``include-site-packages`` is true, then
+    ``allowed-eggs-from-site-packages`` filters what eggs from site-packages
+    may be chosen.  Therefore, if ``allowed-eggs-from-site-packages`` is an
+    empty list, then no eggs from site-packages are chosen, but site-packages
+    will still be included at the end of path lists.
+    
+    If ``include-site-packages`` is false, the value of
+    ``allowed-eggs-from-site-packages`` is irrelevant.
+    
+    The same pattern holds true for the ``include-site-packages-for-buildout``
+    option, except only the bin/buildout script is affected by that
+    interaction.
 
   * Script generation pushes dependency paths that are in site-packages to
     the end of the dependency paths in sys.path (but, as before, these are

Modified: zc.buildout/branches/gary-support-system-python/src/zc/buildout/buildout.txt
===================================================================
--- zc.buildout/branches/gary-support-system-python/src/zc/buildout/buildout.txt	2009-08-11 14:14:59 UTC (rev 102677)
+++ zc.buildout/branches/gary-support-system-python/src/zc/buildout/buildout.txt	2009-08-11 15:39:30 UTC (rev 102678)
@@ -2118,6 +2118,10 @@
     
     If ``include-site-packages`` is false, the value of
     ``allowed-eggs-from-site-packages`` is irrelevant.
+    
+    The same pattern holds true for the ``include-site-packages-for-buildout``
+    option, except only the bin/buildout script is affected by that
+    interaction.
 
 bin-directory
    The directory path where scripts are written.  This can be a

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-08-11 14:14:59 UTC (rev 102677)
+++ zc.buildout/branches/gary-support-system-python/src/zc/buildout/tests.py	2009-08-11 15:39:30 UTC (rev 102678)
@@ -2857,9 +2857,13 @@
 allows you to specify a whitelist of project names that may be included from
 site-packages.
 
-This test shows the option being used in a buildout.
+This test shows the option being used in a buildout.  We try to limit these
+tests to those that test additional parts of the code beyond those tested in
+the test above.
 
-The buildout defaults to a whitelist of ('*',), or any project name.  
+The buildout defaults to a whitelist of ('*',), or any project name.  The
+buildout configuration option defaults are managed separately from the
+zc.buildout.easy_install API defaults, so we show this here.
 
     >>> from zc.buildout.buildout import Buildout
     >>> write('buildout.cfg',
@@ -2872,9 +2876,9 @@
     >>> zc.buildout.easy_install.allowed_eggs_from_site_packages()
     ('*',)
 
-Our "primed_executable" has the "demoneeded," "other," and "setuptools"
+In the test below, our "primed_executable" has the "demoneeded," "other," and "setuptools"
 packages available.  We'll simply be asking for "other" here.  The default
-value of '*' will allow it.
+value of '*' will allow it.  This confirms behaviorally what we saw above.
 
     >>> primed_executable = get_executable_with_site_packages()
     >>> zc.buildout.easy_install.clear_index_cache()
@@ -2883,8 +2887,6 @@
     ... [buildout]
     ... parts = eggs
     ... find-links =
-    ... allowed-eggs-from-site-packages = demoneeded
-    ...                                   other
     ...
     ... [primed_python]
     ... executable = %(primed_executable)s
@@ -2899,7 +2901,8 @@
     Installing eggs.
     <BLANKLINE>
 
-Here we explicitly use a "*" for the same result.
+Here we explicitly use a "*" for the same result.  This also shows that we
+correctly parse a single-line value.
 
     >>> zc.buildout.easy_install.clear_index_cache()
     >>> write('buildout.cfg',
@@ -2922,7 +2925,8 @@
     Updating eggs.
     <BLANKLINE>
 
-Specifying the egg exactly will work as well.
+Specifying the egg exactly will work as well.  This shows we correctly
+parse a multi-line value.
 
     >>> zc.buildout.easy_install.clear_index_cache()
     >>> write('buildout.cfg',
@@ -2946,62 +2950,18 @@
     Updating eggs.
     <BLANKLINE>
 
-It will also work if we use a glob ("*" or "?").
+It will also work if we use a glob ("*" or "?").  (We won't show that here
+because we already tested it in the previous doctest.)
 
-    >>> zc.buildout.easy_install.clear_index_cache()
-    >>> write('buildout.cfg',
-    ... '''
-    ... [buildout]
-    ... parts = eggs
-    ... find-links =
-    ... allowed-eggs-from-site-packages = demoneeded
-    ...                                   ?th*
-    ...
-    ... [primed_python]
-    ... executable = %(primed_executable)s
-    ...
-    ... [eggs]
-    ... recipe = zc.recipe.egg:eggs
-    ... python = primed_python
-    ... eggs = other
-    ... ''' % globals())
-
-    >>> print system(primed_executable+" "+buildout)
-    Updating eggs.
-    <BLANKLINE>
-
 However, if we do not include "other" in the "allowed-eggs-from-site-packages"
 key, we get an error, because the packages are not available in any links, and
-they are not allowed to come from the executable's site packages.
+they are not allowed to come from the executable's site packages. (We won't
+show that here because we already tested it in the previous doctest.)
 
-    >>> zc.buildout.easy_install.clear_index_cache()
-    >>> write('buildout.cfg',
-    ... '''
-    ... [buildout]
-    ... parts = eggs
-    ... find-links =
-    ... allowed-eggs-from-site-packages = demoneeded
-    ...
-    ... [primed_python]
-    ... executable = %(primed_executable)s
-    ...
-    ... [eggs]
-    ... recipe = zc.recipe.egg:eggs
-    ... eggs = other
-    ... ''' % globals())
-    >>> print system(primed_executable+" "+buildout)
-    Uninstalling eggs.
-    Installing eggs.
-    Couldn't find index page for 'other' (maybe misspelled?)
-    Getting distribution for 'other'.
-    While:
-      Installing eggs.
-      Getting distribution for 'other'.
-    Error: Couldn't find a distribution for 'other'.
-    <BLANKLINE>
+Finally, here's a test with an empty value.  It shows that we parse an empty
+value correctly, and verifies that we really are controlling what eggs are
+allowed, because we see that we were unable to get "other".
 
-Finally, here's the same with an empty value.
-
     >>> zc.buildout.easy_install.clear_index_cache()
     >>> write('buildout.cfg',
     ... '''
@@ -3223,7 +3183,7 @@
 
 def create_sample_eggs(test, executable=sys.executable):
     """Creates sample eggs, source distributions, and a faux site-packages."
-    
+
     Unlike the faux site-packages created by
     ``get_executable_with_site_packages``, this one has packages installed the
     way distributions often install eggs in system Pythons (via



More information about the Checkins mailing list