构建、psycopg2、postgresql

发布于 2024-09-28 19:06:13 字数 619 浏览 2 评论 0原文

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

I'm trying to make buildout config that installs psycopg2 egg and postgres from source if needed:

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

The problem is that it always builds postgresql from source, even if the user already has postgresql installed.

How can I tell buildout to check if user already have all necessary to build psycopg2?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不及他 2024-10-05 19:06:13

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

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

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

[buildout]
parts +=
    postgre
    psycopg2

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

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

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

这能解决你的问题吗?

You can do it, but you'll have to make your own recipe to do that check. There's no existing recipe that does what you want.

An alternative is to have two buildout configs. The main buildout.cfg assumes postgresql is available and doesn't attempt to build it.

A second withpostgres.cfg could look like this:

[buildout]
parts +=
    postgre
    psycopg2

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

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

Users that need to build it from source can use the second configuration by calling bin/buildout -c withpostres.cfg.

Would that solve your issue?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文