将PEX与诗歌pyproject.toml一起使用
我试图弄清楚如何使用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.toml
或poetry.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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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.