Commit 225767ad authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Rewrite for zc.buildout >= 2.0.0.

 * Same parts directory as the normal buildout is used so that we can
   build faster and also make the code simpler.
 * Python part is now specified by `python` parameter in `buildout`
   section.
 * Restart automatically with the original python when running python
   part is removed.
parent 26f6d42a
...@@ -4,7 +4,13 @@ Changes ...@@ -4,7 +4,13 @@ Changes
3.2 (unreleased) 3.2 (unreleased)
---------------- ----------------
* No changes yet. * Support zc.buildout >= 2.0.0.
* Same parts directory as the normal buildout is used so that we can
build faster and also make the code simpler.
* Python part is now specified by `python` parameter in `buildout`
section.
* Restart automatically with the original python when running python
part is removed.
3.1 (2011-06-24) 3.1 (2011-06-24)
---------------- ----------------
......
Chicken and egg python zc.buildout extension Rerun buildout with a python provided by buildout
============================================ ===============================================
This extensions for zc.buildout is created to solve chicken and egg problem Buildout 2.0 no-longer supports using multiple versions of Python in a
while working with buildout and when some exact version of python, which is single buildout. This extension makes it possible to use 'yet another
provided by buildout shall be used to *execute* this buildout itself. single' version of python, by building a specified python part and its
dependencies first then reinvoking buildout with the executable.
Usage Usage
----- -----
Part to build python is required. By convention slapos.rebootstrap will try to A part to build python is required. You need to specify it by `python`
find python executable in: parameter in `buildout` section, just same as buildout 1.x. The python
section must provide executable option that gives the path to a Python
executable.
special.parts.directory/partname/bin/partname And add slapos.rebootstrap to `extensions` parameter in `buildout` section.
But when needed python-path parameter can be used to point rebootstrap to find Use whatever python to bootstrap and run buildout. If this extension
python in: detects that sys.executable used to run buildout is different than
executable provided in python section, it will try to find this
special.parts.directory/partname/python-path executable. If it does not exists, it will install this section and
then reinstall buildout using new python executable. Later buildout
Add slapos.rebootstrap to extensions and set rebooter-section to above section. run will continue using new python.
Use whatever python to bootstrap and run buildout. If reboot will detect that
sys.executable used to run buildout is different then executable provided in
python section it will try to find this executable. If it does not exists it
will install this section and then reinstall buildout using new python
executable. Later buildout run will continue using new python.
Because external buildout is used to provide buildout version parameter is
introduced to being able to upgrade not in place python part. This parameter
is required and becomes part of suffix.
Whenever developer-mode is set to true no cleanup will be done in case of
failure. Then user is responsible to cleanup directories.
Example profile and invocation Example profile and invocation
------------------------------ ------------------------------
...@@ -39,14 +29,11 @@ Example profile and invocation ...@@ -39,14 +29,11 @@ Example profile and invocation
[buildout] [buildout]
extensions = slapos.rebootstrap extensions = slapos.rebootstrap
python = slapospython
parts = parts =
realrun realrun
[rebootstrap]
section = slapospython
version = 1
[slapospython] [slapospython]
recipe = plone.recipe.command recipe = plone.recipe.command
stop-on-error = true stop-on-error = true
...@@ -61,7 +48,7 @@ Example profile and invocation ...@@ -61,7 +48,7 @@ Example profile and invocation
After bootstrapping and running this buildout it will print: After bootstrapping and running this buildout it will print:
Running with python /path/to/buildout/parts.rebootstrap.1/slapospython/bin/slapospython Running with python /path/to/buildout/parts/slapospython/bin/slapospython
Running tests Running tests
------------- -------------
......
from setuptools import setup, find_packages from setuptools import setup, find_packages
version = '3.2-dev' version = '3.2'
name = "slapos.rebootstrap" name = "slapos.rebootstrap"
long_description = open("README.txt").read() + '\n\n' long_description = open("README.txt").read() + '\n\n'
...@@ -38,7 +38,7 @@ setup( ...@@ -38,7 +38,7 @@ setup(
zip_safe=True, zip_safe=True,
install_requires=[ install_requires=[
'setuptools', 'setuptools',
'zc.buildout' 'zc.buildout >=2.0.0'
], ],
tests_require=[ tests_require=[
'zope.testing', 'zope.testing',
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment