Hi,
having a problem with my buildout and like to request some hints.
I have a buildout which creates a simple python interpreter environment like explained in the buildout manual. Additionally I use a custom script.
My problem is: How can I tell my_recipe to use the (newly created) mypython interpreter, instead of using the standard python interpreter?
Or as a workaround: Is there a way to install the custom interpreter before the buildout, maybe on bootstrap?
I like to avoid using virtualenv.
TIA and cheers
Udo Spallek
------------ buildout.cfg ------------
[buildout] parts = mypython myrecipe
[mypython] recipe = zc.recipe.egg interpreter = mypython eggs = relatorio
[myrecipe] recipe = my_recipe interpreter = mypython # This doesn't work
On Thu, Aug 19, 2010 at 8:05 AM, Udo Spallek udono@gmx.net wrote:
Hi,
having a problem with my buildout and like to request some hints.
I have a buildout which creates a simple python interpreter environment like explained in the buildout manual.
So an interpreter script.
Additionally I use a custom script.
Not sure what that is or why it matters.
My problem is: How can I tell my_recipe to use the (newly created) mypython interpreter, instead of using the standard python interpreter?
You can't.
Or as a workaround: Is there a way to install the custom interpreter before the buildout, maybe on bootstrap?
The custom interpreter isn't a true Python installation. Generally, you aren't going to be able to bootstrap a buildout with it.
Why do you want to do this? What problem are you trying to solve?
Jim
Hi Jim,
thanks for your reply. I need to re-thing my plan for the builout and found some ideas.
Am Donnerstag, den 19.08.2010, 09:09 -0400 schrieb Jim Fulton:
On Thu, Aug 19, 2010 at 8:05 AM, Udo Spallek udono@gmx.net wrote:
having a problem with my buildout and like to request some hints. I have a buildout which creates a simple python interpreter environment like explained in the buildout manual.
So an interpreter script.
Additionally I use a custom script.
Not sure what that is or why it matters.
It is a script which use the API of a trytond server (www.tryton.org) to create a database and install several modules into this database. The dependencies of trytond server are installed into the mypython environment. So when I wanted to maintain trytond I need to start it within the mypython environment, for now.
My problem is: How can I tell my_recipe to use the (newly created) mypython interpreter, instead of using the standard python interpreter?
You can't.
Or as a workaround: Is there a way to install the custom interpreter before the buildout, maybe on bootstrap?
The custom interpreter isn't a true Python installation. Generally, you aren't going to be able to bootstrap a buildout with it. Why do you want to do this? What problem are you trying to solve?
Problem is to buildout a complete deployment of trytond including a database and installation of all needed modules. The buildout has these coarse-grained stages/parts:
1. Install dependencies into mypython as eggs 2. Install trytond and all tryton-modules needed 3. Create Database/Install Modules: (my custom recipe) import trytond create_database if not exist install_modules into database 4. Debian system works (init.d-script, links to /var/log, /var/run,...)
Part 3 is the problem, because for now, import trytond needs to be started in the mypython environment, because of the dependencies.
I think I rewrite this part and use the xmlrpc API of trytond and start the server in a prior part with a system call to an init.d-script. Then I do the steps from 3. inside the buildout via xmlrpc. This way I do not need the mypython environment in my recipe.
Thanks a lot! Cheers Udo
On 08/19/2010 03:53 PM, udono wrote:
Problem is to buildout a complete deployment of trytond including a database and installation of all needed modules. The buildout has these coarse-grained stages/parts:
- Install dependencies into mypython as eggs
- Install trytond and all tryton-modules needed
- Create Database/Install Modules: (my custom recipe) import trytond create_database if not exist install_modules into database
- Debian system works (init.d-script, links to /var/log, /var/run,...)
Part 3 is the problem, because for now, import trytond needs to be started in the mypython environment, because of the dependencies.
You could make a recipe that just calls bin/mypython with the options you need. os.system() (or rather the subprocess.Popen() call, look at zc.buildout's easyinstall.py around line 147 for an example).
Perhaps make the assumption that you've got a [trytond] part. You can then grab the ${trytond:interpreter} option from within your recipe and grab the bin directory from the buildout options.
Assuming the [trytond] part runs before your recipe you're pretty much set, I'd guess. Bonus points if your recipe can detect whether it actually needs to run by checking whether a database file exists or something like that.
Reinout