gpt4 book ai didi

python - 构建、psycopg2、postgresql

转载 作者:行者123 更新时间:2023-12-01 06:14:35 25 4
gpt4 key购买 nike

我正在尝试制作从源代码安装 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 所需的所有内容?

最佳答案

可以做到这一点,但你必须制定自己的食谱来进行检查。没有现有的配方可以满足您的要求。

另一种方法是使用两个构建配置。主要的 buildout.cfg 假定 postgresql 可用并且不会尝试构建它。

第二个 withpostgres.cfg 可能如下所示:

[buildout]
parts +=
postgre
psycopg2

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

[psycopg2]
... your existing one ...

需要从源代码构建它的用户可以通过调用bin/buildout -c withpostres.cfg来使用第二个配置。

这能解决您的问题吗?

关于python - 构建、psycopg2、postgresql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3999081/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com