[Checkins] SVN: zc.buildout/branches/python-support/ merge gary-9
Gary Poster
gary.poster at canonical.com
Mon Apr 19 15:24:56 EDT 2010
Log message for revision 111139:
merge gary-9
Changed:
A zc.buildout/branches/python-support/
U zc.buildout/branches/python-support/src/zc/buildout/bootstrap.txt
U zc.buildout/branches/python-support/src/zc/buildout/buildout.py
U zc.buildout/branches/python-support/src/zc/buildout/buildout.txt
U zc.buildout/branches/python-support/src/zc/buildout/easy_install.py
U zc.buildout/branches/python-support/src/zc/buildout/easy_install.txt
-=-
Property changes on: zc.buildout/branches/python-support
___________________________________________________________________
Added: svn:ignore
+ eggs
develop-eggs
parts
.installed.cfg
bin
dist
build
doc.txt
doc.html
Added: svn:mergeinfo
+ /zc.buildout/branches/gary-6:109416,109421,109426
/zc.buildout/branches/gary-7:109424,109427
/zc.buildout/branches/gary-5:109383,109387,109425
/zc.buildout/trunk:108946,109993,109996
/zc.buildout/branches/gary-8:109905,110061,110066-110067
/zc.buildout/branches/gary-9:111137-111138
Added: svk:merge
+ 62d5b8a3-27da-0310-9561-8e5933582275:/zc.buildout/branches/gary-8:109905
62d5b8a3-27da-0310-9561-8e5933582275:/zc.buildout/branches/gary-8:110061
62d5b8a3-27da-0310-9561-8e5933582275:/zc.buildout/branches/gary-8:110066
62d5b8a3-27da-0310-9561-8e5933582275:/zc.buildout/branches/gary-8:110067
62d5b8a3-27da-0310-9561-8e5933582275:/zc.buildout/branches/gary-9:111138
62d5b8a3-27da-0310-9561-8e5933582275:/zc.buildout/trunk:108946
62d5b8a3-27da-0310-9561-8e5933582275:/zc.buildout/trunk:109996
Modified: zc.buildout/branches/python-support/src/zc/buildout/bootstrap.txt
===================================================================
--- zc.buildout/branches/gary-launchpad/src/zc/buildout/bootstrap.txt 2010-03-19 21:53:25 UTC (rev 110073)
+++ zc.buildout/branches/python-support/src/zc/buildout/bootstrap.txt 2010-04-19 19:24:56 UTC (rev 111139)
@@ -47,7 +47,7 @@
X...
d zc.buildout-...egg
-Now trying the `--version` option, that let you define a version for
+Now we will try the `--version` option, which lets you define a version for
`zc.buildout`. If not provided, bootstrap will look for the latest one.
Let's try with an unknown version::
Modified: zc.buildout/branches/python-support/src/zc/buildout/buildout.py
===================================================================
--- zc.buildout/branches/gary-launchpad/src/zc/buildout/buildout.py 2010-03-19 21:53:25 UTC (rev 110073)
+++ zc.buildout/branches/python-support/src/zc/buildout/buildout.py 2010-04-19 19:24:56 UTC (rev 111139)
@@ -129,6 +129,7 @@
'parts-directory': 'parts',
'prefer-final': 'false',
'python': 'buildout',
+ 'relative-paths': 'false',
'socket-timeout': '',
'unzip': 'false',
'use-dependency-links': 'true',
@@ -411,9 +412,16 @@
partsdir = os.path.join(options['parts-directory'], 'buildout')
if not os.path.exists(partsdir):
os.mkdir(partsdir)
+ # (Honor the relative-paths option.)
+ relative_paths = options.get('relative-paths', 'false')
+ if relative_paths == 'true':
+ relative_paths = options['directory']
+ else:
+ assert relative_paths == 'false'
+ relative_paths = ''
zc.buildout.easy_install.sitepackage_safe_scripts(
options['bin-directory'], ws, options['executable'], partsdir,
- reqs=['zc.buildout'])
+ reqs=['zc.buildout'], relative_paths=relative_paths)
init = bootstrap
Modified: zc.buildout/branches/python-support/src/zc/buildout/buildout.txt
===================================================================
--- zc.buildout/branches/gary-launchpad/src/zc/buildout/buildout.txt 2010-03-19 21:53:25 UTC (rev 110073)
+++ zc.buildout/branches/python-support/src/zc/buildout/buildout.txt 2010-04-19 19:24:56 UTC (rev 111139)
@@ -767,8 +767,9 @@
DEFAULT_VALUE
python= buildout
DEFAULT_VALUE
+ relative-paths= false
+ DEFAULT_VALUE
socket-timeout=
- DEFAULT_VALUE
unzip= false
DEFAULT_VALUE
use-dependency-links= true
@@ -2286,6 +2287,7 @@
parts-directory = /sample-buildout/parts
prefer-final = false
python = buildout
+ relative-paths = false
socket-timeout =
unzip = false
use-dependency-links = true
@@ -2349,6 +2351,33 @@
Python executable. By default, the buildout section defines the
default Python as the Python used to run the buildout.
+relative-paths
+ The paths generated by zc.buildout are absolute by default, and this
+ option is ``false``. However, if you set this value to be ``true``,
+ bin/buildout will be generated with code that makes the paths relative.
+ Some recipes, such as zc.recipe.egg and z3c.recipe.scripts, honor this
+ value as well.
+
+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.
@@ -2395,9 +2424,57 @@
directory if the original buildout had develop eggs for either
buildout or setuptools.)
-Note that the buildout script was installed but not run. To run
-the buildout, we'd have to run the installed buildout script.
+If relative-paths is ``true``, the buildout script uses relative paths.
+ >>> write(sample_bootstrapped, 'setup.cfg',
+ ... '''
+ ... [buildout]
+ ... relative-paths = true
+ ... parts =
+ ... ''')
+
+ >>> print system(buildout
+ ... +' -c'+os.path.join(sample_bootstrapped, 'setup.cfg')
+ ... +' bootstrap'),
+ Generated script '/sample-bootstrapped/bin/buildout'.
+
+ >>> buildout_script = join(sample_bootstrapped, 'bin', 'buildout')
+ >>> import sys
+ >>> if sys.platform.startswith('win'):
+ ... buildout_script += '-script.py'
+ >>> print open(buildout_script).read() # doctest: +ELLIPSIS
+ #!... -S
+ <BLANKLINE>
+ import os
+ <BLANKLINE>
+ join = os.path.join
+ base = os.path.dirname(os.path.abspath(os.path.realpath(__file__)))
+ base = os.path.dirname(base)
+ <BLANKLINE>
+ import sys
+ sys.path[0:0] = [
+ join(base, 'parts/buildout'),
+ ]
+ <BLANKLINE>
+ <BLANKLINE>
+ import os
+ path = sys.path[0]
+ if os.environ.get('PYTHONPATH'):
+ path = os.pathsep.join([path, os.environ['PYTHONPATH']])
+ os.environ['PYTHONPATH'] = path
+ import site # imports custom buildout-generated site.py
+ <BLANKLINE>
+ import zc.buildout.buildout
+ <BLANKLINE>
+ if __name__ == '__main__':
+ zc.buildout.buildout.main()
+ <BLANKLINE>
+
+
+Note that, in the above two examples, the buildout script was installed
+but not run. To run the buildout, we'd have to run the installed
+buildout script.
+
If we have an existing buildout that already has a buildout.cfg, we'll
normally use the bootstrap command instead of init. It will complain
if there isn't a configuration file:
Modified: zc.buildout/branches/python-support/src/zc/buildout/easy_install.py
===================================================================
--- zc.buildout/branches/gary-launchpad/src/zc/buildout/easy_install.py 2010-03-19 21:53:25 UTC (rev 110073)
+++ zc.buildout/branches/python-support/src/zc/buildout/easy_install.py 2010-04-19 19:24:56 UTC (rev 111139)
@@ -1199,12 +1199,12 @@
return generated
_script_initialization_template = '''
-import site # imports custom buildout-generated site.py
import os
-path = %(site_py_dest)r
+path = sys.path[0]
if os.environ.get('PYTHONPATH'):
path = os.pathsep.join([path, os.environ['PYTHONPATH']])
os.environ['PYTHONPATH'] = path
+import site # imports custom buildout-generated site.py
%(script_initialization)s'''
# Utilities for the script generation functions.
Modified: zc.buildout/branches/python-support/src/zc/buildout/easy_install.txt
===================================================================
--- zc.buildout/branches/gary-launchpad/src/zc/buildout/easy_install.txt 2010-03-19 21:53:25 UTC (rev 110073)
+++ zc.buildout/branches/python-support/src/zc/buildout/easy_install.txt 2010-04-19 19:24:56 UTC (rev 111139)
@@ -1498,12 +1498,12 @@
]
<BLANKLINE>
<BLANKLINE>
- import site # imports custom buildout-generated site.py
import os
- path = '/interpreter/parts/interpreter'
+ path = sys.path[0]
if os.environ.get('PYTHONPATH'):
path = os.pathsep.join([path, os.environ['PYTHONPATH']])
os.environ['PYTHONPATH'] = path
+ import site # imports custom buildout-generated site.py
<BLANKLINE>
import eggrecipedemo
<BLANKLINE>
@@ -1542,12 +1542,12 @@
'/interpreter/parts/interpreter',
]
<BLANKLINE>
- import site # imports custom buildout-generated site.py
import os
- path = '/interpreter/parts/interpreter'
+ path = sys.path[0]
if os.environ.get('PYTHONPATH'):
path = os.pathsep.join([path, os.environ['PYTHONPATH']])
os.environ['PYTHONPATH'] = path
+ import site # imports custom buildout-generated site.py
import os
os.chdir("foo")
<BLANKLINE>
More information about the checkins
mailing list