Bazel sh_binary 是否允许调用依赖于某些 pip 包的脚本?

发布于 2025-01-16 19:55:06 字数 655 浏览 2 评论 0原文

我有以下 sh_binary

sh_binary(
    name="worker",
    srcs=["worker.sh"],
)

worker.sh 看起来

#!/bin/bash
celery -A twoopstracker worker -l INFO &> /app/logs/celery.log &

celery 已使用 pip_install 安装,并且可以被其他 py_binary 依赖,使用诸如 requirement("celery") 之类的东西,

有没有办法让 worker.sh 也可以访问这些要求将使其能够运行 成功地? 我无法使用 deps = [requirement("celery"),] 添加,因为 celery 是 py_library 规则 并且需要 sh_library

有没有办法让sh_binary使用已安装的celery

我已经尝试过这里的方法

I have the following sh_binary

sh_binary(
    name="worker",
    srcs=["worker.sh"],
)

and the worker.sh looks like

#!/bin/bash
celery -A twoopstracker worker -l INFO &> /app/logs/celery.log &

the celery has been installed using pip_install and can be depended upon by other py_binary using something like requirement("celery"),

Is there a way to make the worker.sh also have access to these requirements which will enable it to run successfully?
I can't add using the deps = [requirement("celery"),] since celery is a py_library rule and sh_library is expected.

is there a way to make the sh_binary use the installed celery?

I've tried the approach here

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文