Python 从结构部署的虚拟环境中使用Poetry构建控制盘
我正在构建一个Flask应用程序,使用Fabric进行部署,使用Poetry进行依赖关系管理 在my fabfile.py中,我正在执行以下操作:Python 从结构部署的虚拟环境中使用Poetry构建控制盘,python,flask,fabric,python-poetry,Python,Flask,Fabric,Python Poetry,我正在构建一个Flask应用程序,使用Fabric进行部署,使用Poetry进行依赖关系管理 在my fabfile.py中,我正在执行以下操作: @task def deploy(ctx): with Connection(ctx.host, ctx.user) as conn: print("* building release") conn.local("rm -rf dist") conn.local("poe
@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中运行fabric,因此在venv中运行poetry build
命令,这会引发错误:
% poetry run fab deploy
* building release
/bin/bash: poetry: command not found
如何在部署脚本中构建控制盘,同时在venv中运行脚本