[Zope3-Users] Buildout and custom python

Darryl Cousins darryl at darrylcousins.net.nz
Thu Dec 20 21:50:11 EST 2007


Hi,

On Thu, 2007-12-20 at 21:58 -0400, David Pratt wrote:
> Right. Thanks for this, there are couple of solutions here and shell 
> script is a reasonable solution but these methods seems counter to the 
> simplicity of buildout. I had also seen a rebootstrap package in svn. I 
> wonder if something similar could not be accomplished this way using 
> python with a means of producing a callback. I really don't want 
> anything too messy to accomplish this. Many thanks.

Yes ... I somehow felt that it should be possible with buildout alone.
But that said I'm content with the shell script solution.

Regards,
Darryl

> 
> Regards,
> David
> 
> 
> Darryl Cousins wrote:
> > Hi David,
> > 
> > I've tried out the methods described here:
> > http://mail.python.org/pipermail/distutils-sig/2007-November/008489.html
> > 
> > and have plumped for the buildout.sh shell script which builds python
> > and then uses that to bootstrap and re-continue the buildout. It is
> > working well and I see that all eggs are then compiled with the compiled
> > python.
> > 
> > I had already begun using a Makefile to build/test/run the project so I
> > find it convenient to use a shell script in the mix.
> > 
> > Regards,
> > Darryl
> > 
> > On Thu, 2007-12-20 at 21:03 -0400, David Pratt wrote:
> >> Hey Darryl. Our minds were in a similar place today. I finally had 
> >> decided to move away from my system python starting on my mac and also 
> >> having a spot of trouble. I put something simple together below to 
> >> illustrate what happened in my instance.
> >>
> >> Here the eggs built with the python would not install. I initially 
> >> though it was the lxml I was compiling, but it was just happened to be 
> >> the first part requiring the custom-python. Eggs were made, and I could 
> >> see the temp folder also, but when was finalizing the install, it threw 
> >> the error and without much verbosity, the tempfolder it was installing 
> >> into disappeared.
> >>
> >> Note, I did not include the custom-python as a part in the buildout. I 
> >> tend to like the python24:location type of notation since it is fairly 
> >> explicit when you have a number of pieces of software you are building.
> >>
> >> Regards
> >> David
> >>
> >> [buildout]
> >> develop = .
> >> parts = python24
> >>          interpreter
> >> index = http://download.zope.org/ppix
> >> log-level = DEBUG
> >>
> >> [python24]
> >> recipe = zc.recipe:cmmi
> >> url = http://python.org/ftp/python/2.4.4/Python-2.4.4.tgz
> >>
> >> [custom-python]
> >> executable = ${python24:location}/bin/python
> >>
> >> [interpreter]
> >> recipe = zc.recipe.egg
> >> interpreter = interpreter
> >> eggs = Cheetah==1.0
> >> python = custom-python
> >>
> >>
> >> Here are the highlights:
> >>
> >> Some verification it is using the right python...
> >>
> >> Getting distribution for 'Cheetah==1.0'.
> >> We have the best distribution that satisfies 'setuptools'.
> >> Picked: setuptools = 0.6c7
> >> Running easy_install:
> >> /Users/davidpratt/Desktop/Buildouts/osxdeploy2/parts/python24/bin/python 
> >> "-c" "from setuptools.command.easy_install import main; main()" "-mUNxd" 
> >> "/Users/davidpratt/Desktop/Buildouts/osxdeploy2/eggs/tmprQq-MH" "-v" 
> >> "/Users/davidpratt/Desktop/Buildouts/download-cache/dist/Cheetah-1.0.tar.gz"
> >> path=/Users/davidpratt/Desktop/Buildouts/osxdeploy2/eggs/setuptools-0.6c7-py2.4.egg
> >>
> >> Processing Cheetah-1.0.tar.gz
> >>
> >> Last few lines of output.. some time later.
> >>
> >> changing mode of 
> >> /Users/davidpratt/Desktop/Buildouts/osxdeploy2/eggs/tmprQq-MH/Cheetah-1.0-py2.4-macosx-10.3-ppc.egg/EGG-INFO/top_level.txt 
> >> to 755
> >> changing mode of 
> >> /Users/davidpratt/Desktop/Buildouts/osxdeploy2/eggs/tmprQq-MH/Cheetah-1.0-py2.4-macosx-10.3-ppc.egg/EGG-INFO/scripts/cheetah 
> >> to 755
> >> changing mode of 
> >> /Users/davidpratt/Desktop/Buildouts/osxdeploy2/eggs/tmprQq-MH/Cheetah-1.0-py2.4-macosx-10.3-ppc.egg/EGG-INFO/scripts/cheetah-compile 
> >> to 755
> >>
> >> Installed 
> >> /Users/davidpratt/Desktop/Buildouts/osxdeploy2/eggs/tmprQq-MH/Cheetah-1.0-py2.4-macosx-10.3-ppc.egg
> >>
> >> Because this distribution was installed --multi-version, before you can
> >> import modules from this package in an application, you will need to
> >> 'import pkg_resources' and then use a 'require()' call similar to one of
> >> these examples, in order to select the desired version:
> >>
> >>      pkg_resources.require("Cheetah")  # latest installed version
> >>      pkg_resources.require("Cheetah==1.0")  # this exact version
> >>      pkg_resources.require("Cheetah>=1.0")  # this version or higher
> >>
> >>
> >> Note also that the installation directory must be on sys.path at runtime for
> >> this to work.  (e.g. by being the application's script directory, by 
> >> being on
> >> PYTHONPATH, or by being added to sys.path by your code.)
> >>
> >> While:
> >>    Installing interpreter.
> >>    Getting distribution for 'Cheetah==1.0'.
> >> Error: Couldn't install: Cheetah 1.0
> >> [mac-pg:~/Desktop/Buildouts/osxdeploy2] davidpra%
> >>
> >> Jim Fulton wrote:
> >>> On Dec 20, 2007, at 6:03 PM, Darryl Cousins wrote:
> >>>> I'm trying to created an isolated environment using buildout. I had
> >>>> understood that defining a custom build python would ensure that all
> >>>> eggs are installed and compiled with the custom python.
> >>>>
> >>>> But when the buildout comes to install ZODB it is being compiled agains
> >>>> the system python headers. (-I/usr/include/python2.4). Which is not what
> >>>> I want, and at that point the custom python has not even been built.
> >>>>
> >>>> Any thoughts.
> >>>>
> >>>> [buildout]
> >>>> python = custom-python
> >>>> parts = python
> >>>>     custom-python
> >>>>
> >>>>
> >>>> [python]
> >>>> recipe = zc.recipe.cmmi
> >>>> url = http://www.python.org/ftp/python/2.4.4/Python-2.4.4.tar.bz2
> >>>> extra_options = --with-threads
> >>>>                --with-readline
> >>>>                --enable-unicode=ucs2
> >>>>
> >>>> [custom-python]
> >>>> executable = ${buildout:parts-directory}/python/bin/python
> >>>
> >>> Your buildout doesn't mention ZODB3 or anything that uses it, so it is 
> >>> hard to comment.
> >>>
> >>> Jim
> >>>
> >>> -- 
> >>> Jim Fulton
> >>> Zope Corporation
> >>>
> >>>
> >>> _______________________________________________
> >>> Zope3-users mailing list
> >>> Zope3-users at zope.org
> >>> http://mail.zope.org/mailman/listinfo/zope3-users
> >>>
> > 



More information about the Zope3-users mailing list