How to specify where to place buildout bootstrap generated folders?
I have the following folder structure:
bootstrap.py
setup.py
conf/
buildout.cfg
Now how do I make it so that running python bootstrap.py
puts开发者_高级运维 the generated folders bin, eggs, parts, etc. on the root instead of under conf folder?
The base directory for buildout is always the directory that the starting configuration file is found in, so in your case that's in conf/
.
There are two work-arounds for this, one easy, one harder. The first is to just place a bare buildout.cfg
file in the root, and have it include the file in conf/
:
[buildout]
extends = conf/buildout.cfg
Alternatively, you can set the *-directory
options in your conf/buildout.cfg
file for each of the eggs
, develop-eggs
, parts
and bin
directories:
[buildout]
bin-directory = ../bin
parts-directory = ../parts
eggs-directory = ../eggs
develop-eggs-directory = ../develop-eggs
That'll set the these directories to the parent of your conf/
directory; e.g. the same directory your bootstrap file is in.
However, any recipe that still refers to ${buildout:directory}
will still use the conf/
directory insead of your project root dir. You cannot set that option to a relative path, you must either let buildout set it for you or specify a full path:
[buildout]
directory = /full/path/to/directory
In my opinion, you are best off using the first option, it makes running the bootstrap script easier anyway as it by default looks for a buildout.cfg
file in the current directory.
Create a buildout.cfg
in your root, which extends your buildout in conf directory:
[buildout]
extends=conf/buildout.cfg
I usually have few buildout config files for example: base
, developer
, deployment
under directory buildout
, so I use this method myself to bootstrap the file I need.
精彩评论