在结构部署的虚拟环境中使用 Poetry 构建轮子

问题描述

我正在构建一个 Flask 应用,使用 Fabric 进行部署,使用 Poetry 进行依赖管理。

在我的 fabfile.py 中我正在做:

@task
def deploy(ctx):
  with Connection(ctx.host,ctx.user) as conn:
    print("* building release")
    conn.local("rm -rf dist")
    conn.local("poetry build -f wheel")
    ...

由于我在 venv 中运行结构,因此 poetry build 命令在 venv 中运行,这会引发错误

% poetry run fab deploy
* building release
/bin/bash: poetry: command not found

如何在部署脚本中构建轮子,同时在 Poetry venv 中运行脚本?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)