将PEX与诗歌pyproject.toml一起使用

发布于 2025-01-22 15:14:50 字数 707 浏览 2 评论 0原文

我试图弄清楚如何使用PEX进行Python项目进行自动化(ISH)部署。我目前有以下过程:

$ poetry run pip freeze > requirements.txt 
manually remove this-project line from requirements.txt
$ poetry run pex -r requirements.txt -o service.pex -e api:start --sources-directory=.
$ ./service.pex

第二步的原因是,如果我留下来,PEX将尝试在线查找this-project。我理解,但是pip冻结代码>确实将该行插入unignts.txt中。我想知道的是:PEX可以使用pyproject.tomlpoetry.lock吗?当前的解决方案是一种令人讨厌的工作。

我已经看过 2019教程 t工作,因为当前版本的PEX无法识别- 项目作为选项。

任何其他建议将不胜感激。

I'm trying to figure out how to do automated(ish) deployment for a python project with pex. I currently have the following process:

$ poetry run pip freeze > requirements.txt 
manually remove this-project line from requirements.txt
$ poetry run pex -r requirements.txt -o service.pex -e api:start --sources-directory=.
$ ./service.pex

The reason for the second step is that pex will try to find this-project online if I leave the line in. This I understand, but pip freeze does insert that line in requirements.txt. What I'm wondering is: can pex use pyproject.toml or poetry.lock directly? The current solution is kind of an annoying work around.

I've looked at 2019 tutorial and it doesn't work, since the current version of pex doesn't recognize --project as an option.

Any other suggestions would be greatly appreciated.

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

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

发布评论

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

评论(1

赠佳期 2025-01-29 15:14:50

PEX怎么样。 -o service.pex -e api:start? PEX了解如何构建任何PEP-517 / PEP-518 Pyproject.toml,如果您正在使用诗歌。

How about pex . -o service.pex -e api:start? Pex understands how to build any PEP-517 / PEP-518 pyproject.toml, which you've got if you're using Poetry.

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