Python 构建、psycopg2、postgresql

Python 构建、psycopg2、postgresql,python,django,buildout,Python,Django,Buildout,我正在尝试构建配置,如果需要,可以从源代码安装psycopg2 egg和postgres: parts = ... postgre psycopg2 ... [postgre] recipe = hexagonit.recipe.cmmi url = ftp://ftp3.ua.postgresql.org/pub/mirrors/postgresql/source/v9.0.0/postgresql-9.0.0.tar.gz configure-options

我正在尝试构建配置,如果需要,可以从源代码安装psycopg2 egg和postgres:

parts =
    ...
    postgre
    psycopg2
    ...

[postgre]
recipe = hexagonit.recipe.cmmi
url = ftp://ftp3.ua.postgresql.org/pub/mirrors/postgresql/source/v9.0.0/postgresql-9.0.0.tar.gz
configure-options =
    --without-readline

[psycopg2]
recipe = zc.recipe.egg:custom
egg = psycopg2
include-dirs =
    ${postgre:location}/include
library-dirs =
    ${postgre:location}/lib
rpath =
    ${postgre:location}/lib
问题是它总是从源代码构建postgresql,即使用户已经安装了postgresql

我如何告诉buildout检查用户是否已经具备了构建psycopg2所需的所有必要条件?

您可以这样做,但您必须自己制作检查方法。没有现成的食谱可以满足你的需求

另一种选择是有两个构建配置。main
buildout.cfg
假定postgresql可用,并且不尝试构建它

使用postgres.cfg的第二个
可能如下所示:

[buildout]
parts +=
    postgre
    psycopg2

[postgres]
... your existing one ...

[psycopg2]
... your existing one ...
需要从源代码构建它的用户可以通过调用
bin/buildout-c with postres.cfg
使用第二种配置

这能解决你的问题吗