小编use*_*077的帖子

如何使用 python诗以独立的方式将包安装到 virtualenv ?

我最近迁移到poetry我的依赖项管理,所以如果我的问题超出了poetry这里的范围,请原谅。

最终目标

我的最终目标是创建一个RPM 包,其中包含一个virtualenv,其中安装了我的软件及其所有依赖项。然后,该 RPM 将提供与安装该软件的系统隔离的软件。

重现问题

我在使用poetry install我的virtualenv. 一旦我的软件的源目录被删除,我的CLI就无法再工作。

复制

我创建了一个简单的存储库来重现问题:https ://github.com/riton/python-poetry-venv

这是我正在使用的poetry

#!/bin/bash -ex

VENV_DIR="/venv"
SRC_DIR="/src"
ALT_SRC_DIR="/src2"
USER_CACHE_DIR="~/.cache"

# Copy directory (cause we're mounting it read-only in the container)
# and we want to remove the source directory later on
cp -r $SRC_DIR $ALT_SRC_DIR

# We'll remove this directory to test if the soft is still working
# …
Run Code Online (Sandbox Code Playgroud)

python virtualenv python-poetry

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

python ×1

python-poetry ×1

virtualenv ×1