[Checkins] SVN: zc.buildout/branches/gary-support-system-python/src/zc/buildout/buildout. add and rearrange docs for the boolean [buildout] options, including my new one, in buildout.txt; make sure that the boolean defaults are listed in buildout -vv output.

Gary Poster gary.poster at canonical.com
Tue Jul 7 14:17:40 EDT 2009


Log message for revision 101718:
  add and rearrange docs for the boolean [buildout] options, including my new one, in buildout.txt; make sure that the boolean defaults are listed in buildout -vv output.

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

-=-
Modified: zc.buildout/branches/gary-support-system-python/src/zc/buildout/buildout.py
===================================================================
--- zc.buildout/branches/gary-support-system-python/src/zc/buildout/buildout.py	2009-07-07 15:40:47 UTC (rev 101717)
+++ zc.buildout/branches/gary-support-system-python/src/zc/buildout/buildout.py	2009-07-07 18:17:40 UTC (rev 101718)
@@ -211,27 +211,30 @@
         if versions:
             zc.buildout.easy_install.default_versions(dict(self[versions]))
 
-        prefer_final = options.get('prefer-final', 'false')
+        prefer_final = options.setdefault('prefer-final', 'false')
         if prefer_final not in ('true', 'false'):
             self._error('Invalid value for prefer-final option: %s',
                         prefer_final)
         zc.buildout.easy_install.prefer_final(prefer_final=='true')
 
-        include_site_packages = options.get('include-site-packages', 'true')
+        include_site_packages = options.setdefault(
+            'include-site-packages', 'true')
         if include_site_packages not in ('true', 'false'):
             self._error('Invalid value for include-site-packages option: %s',
                         include_site_packages)
         zc.buildout.easy_install.include_site_packages(
             include_site_packages=='true')
 
-        use_dependency_links = options.get('use-dependency-links', 'true')
+        use_dependency_links = options.setdefault(
+            'use-dependency-links', 'true')
         if use_dependency_links not in ('true', 'false'):
             self._error('Invalid value for use-dependency-links option: %s',
                         use_dependency_links)
         zc.buildout.easy_install.use_dependency_links(
-            use_dependency_links == 'true')
+            use_dependency_links=='true')
 
-        allow_picked_versions = options.get('allow-picked-versions', 'true')
+        allow_picked_versions = options.setdefault(
+            'allow-picked-versions', 'true')
         if allow_picked_versions not in ('true', 'false'):
             self._error('Invalid value for allow-picked-versions option: %s',
                         allow_picked_versions)
@@ -253,23 +256,20 @@
 
             zc.buildout.easy_install.download_cache(download_cache)
 
-        install_from_cache = options.get('install-from-cache')
-        if install_from_cache:
-            if install_from_cache not in ('true', 'false'):
-                self._error('Invalid value for install-from-cache option: %s',
-                            install_from_cache)
-            if install_from_cache == 'true':
-                zc.buildout.easy_install.install_from_cache(True)
+        install_from_cache = options.setdefault(
+            'install-from-cache', 'false')
+        if install_from_cache not in ('true', 'false'):
+            self._error('Invalid value for install-from-cache option: %s',
+                        install_from_cache)
+        zc.buildout.easy_install.install_from_cache(
+            install_from_cache=='true')
 
+        always_unzip = options.setdefault('unzip', 'false')
+        if always_unzip not in ('true', 'false'):
+            self._error('Invalid value for unzip option: %s',
+                        always_unzip)
+        zc.buildout.easy_install.always_unzip(always_unzip=='true')
 
-        always_unzip = options.get('unzip')
-        if always_unzip:
-            if always_unzip not in ('true', 'false'):
-                self._error('Invalid value for unzip option: %s',
-                            always_unzip)
-            if always_unzip == 'true':
-                zc.buildout.easy_install.always_unzip(True)
-
         # "Use" each of the defaults so they aren't reported as unused options.
         for name in _buildout_default_options:
             options[name]

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-07-07 15:40:47 UTC (rev 101717)
+++ zc.buildout/branches/gary-support-system-python/src/zc/buildout/buildout.txt	2009-07-07 18:17:40 UTC (rev 101718)
@@ -2029,11 +2029,14 @@
     <BLANKLINE>
     Configuration data:
     [buildout]
+    allow-picked-versions = true
     bin-directory = /sample-buildout/bin
     develop-eggs-directory = /sample-buildout/develop-eggs
     directory = /sample-buildout
     eggs-directory = /sample-buildout/eggs
     executable = /usr/local/bin/python2.3
+    include-site-packages = true
+    install-from-cache = false
     installed = /sample-buildout/.installed.cfg
     log-format = 
     log-level = INFO
@@ -2041,7 +2044,10 @@
     offline = false
     parts = 
     parts-directory = /sample-buildout/parts
+    prefer-final = false
     python = buildout
+    unzip = false
+    use-dependency-links = true
     verbosity = 20
     <BLANKLINE>
 
@@ -2049,6 +2055,14 @@
 command-line assignments.  We've discussed most of these options
 already, but let's review them and touch on some we haven't discussed:
 
+allow-picked-versions
+    By default, the buildout will choose the best match for a given requirement
+    if the requirement is not specified precisely (for instance, using the
+    "versions" option.  This behavior corresponds to the
+    "allow-picked-versions" being set to its default value, "true".  If
+    "allow-picked-versions" is "false," instead of picking the best match,
+    buildout will raise an error.  This helps enforce repeatability.
+
 bin-directory
    The directory path where scripts are written.  This can be a
    relative path, which is interpreted relative to the directory
@@ -2073,6 +2087,24 @@
    The Python executable used to run the buildout.  See the python
    option below.
 
+include-site-packages
+    By default, buildout will look for dependencies in the system's
+    site-packages.  For this purpose, 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.  The include-site-packages buildout option can be used to override
+    the default behavior of using site packages
+    ("include-site-packages = false").
+
+install-from-cache
+    A download cache can be used as the basis of application source releases. 
+    In an application source release, we want to distribute an application that
+    can be built without making any network accesses.  In this case, we
+    distribute a buildout with download cache and tell the buildout to install
+    from the download cache only, without making network accesses.  The
+    buildout install-from-cache option can be used to signal that packages
+    should be installed only from the download cache.
+
 installed
    The file path where information about the results of the previous
    buildout run is written.  This can be a relative path, which is
@@ -2086,12 +2118,51 @@
 log-level
    The log level before verbosity adjustment
 
+newest
+    By default buildout and recipes will try to find the newest versions of
+    distributions needed to satisfy requirements.  This can be very time
+    consuming, especially when incrementally working on setting up a buildout
+    or working on a recipe.  The buildout "newest" option can be used to to
+    suppress this.  If the "newest" option is set to false, then new
+    distributions won't be sought if an installed distribution meets
+    requirements.  The "newest" option can also be set to false using the -N
+    command-line option.  See also the "offline" option.
+
+offline
+    The "offline" option goes a bit further than the "newest" option.  If the
+    buildout "offline" option is given a value of "true", the buildout and
+    recipes that are aware of the option will avoid doing network access.  This
+    is handy when running the buildout when not connected to the internet.  It
+    also makes buildouts run much faster. This option is typically set using
+    the buildout -o option.
+
 parts
    A white space separated list of parts to be installed.
 
 parts-directory
    A working directory that parts can used to store data.
 
+prefer-final
+    Currently, when searching for new releases, the newest available
+    release is used.  This isn't usually ideal, as you may get a
+    development release or alpha releases not ready to be widely used.
+    You can request that final releases be preferred using the prefer
+    final option in the buildout section::
+    
+      [buildout]
+      ...
+      prefer-final = true
+    
+    When the prefer-final option is set to true, then when searching for
+    new releases, final releases are preferred.  If there are final
+    releases that satisfy distribution requirements, then those releases
+    are used even if newer non-final releases are available.  The buildout
+    prefer-final option can be used to override this behavior.
+    
+    In buildout version 2, final releases will be preferred by default.
+    You will then need to use a false value for prefer-final to get the
+    newest releases.
+
 python
    The name of a section containing information about the default
    Python interpreter.  Recipes that need a installation
@@ -2102,6 +2173,26 @@
    Python executable.  By default, the buildout section defines the
    default Python as the Python used to run the buildout.
 
+unzip
+    By default, zc.buildout doesn't unzip zip-safe eggs ("unzip = false"). 
+    This follows the policy followed by setuptools itself.  Experience shows
+    this policy to to be inconvenient.  Zipped eggs make debugging more
+    difficult and often import more slowly.  You can include an unzip option in
+    the buildout section to change the default unzipping policy ("unzip =
+    true").
+
+use-dependency-links
+    By default buildout will obey the setuptools dependency_links metadata
+    when it looks for dependencies. This behavior can be controlled with
+    the use-dependency-links buildout option::
+    
+      [buildout]
+      ...
+      use-dependency-links = false
+    
+    The option defaults to true. If you set it to false, then dependency
+    links are only looked for in the locations specified by find-links.
+
 verbosity
    A log-level adjustment.  Typically, this is set via the -q and -v
    command-line options.
@@ -2180,48 +2271,6 @@
     Generated script '/sample-bootstrapped2/bin/buildout'.
 
 
-Newest and Offline Modes
-------------------------
-
-By default buildout and recipes will try to find the newest versions
-of distributions needed to satisfy requirements.  This can be very
-time consuming, especially when incrementally working on setting up a
-buildout or working on a recipe.  The buildout newest option can be
-used to to suppress this.  If the newest option is set to false, then
-new distributions won't be sought if an installed distribution meets
-requirements.  The newest option can be set to false using the -N
-command-line option.
-
-The offline option goes a bit further.  If the buildout offline option
-is given a value of "true", the buildout and recipes that are aware of
-the option will avoid doing network access.  This is handy when
-running the buildout when not connected to the internet.  It also
-makes buildouts run much faster. This option is typically set using
-the buildout -o option.
-
-Preferring Final Releases
--------------------------
-
-Currently, when searching for new releases, the newest available
-release is used.  This isn't usually ideal, as you may get a
-development release or alpha releases not ready to be widely used.
-You can request that final releases be preferred using the prefer
-final option in the buildout section::
-
-  [buildout]
-  ...
-  prefer-final = true
-
-When the prefer-final option is set to true, then when searching for
-new releases, final releases are preferred.  If there are final
-releases that satisfy distribution requirements, then those releases
-are used even if newer non-final releases are available.  The buildout
-prefer-final option can be used to override this behavior.
-
-In buildout version 2, final releases will be preferred by default.
-You will then need to use a false value for prefer-final to get the
-newest releases.
-
 Finding distributions
 ---------------------
 
@@ -2270,20 +2319,7 @@
       /some/otherpath
       /some/path/someegg-1.0.0-py2.3.egg
 
-Dependency links
-----------------
 
-By default buildout will obey the setuptools dependency_links metadata
-when it looks for dependencies. This behavior can be controlled with
-the use-dependency-links buildout option::
-
-  [buildout]
-  ...
-  use-dependency-links = false
-
-The option defaults to true. If you set it to false, then dependency
-links are only looked for in the locations specified by find-links.
-
 Controlling the installation database
 -------------------------------------
 



More information about the Checkins mailing list