Pip 7.0.1 没有从包中安装包含的文件

Pip 7.0.1 not installing included files from package

我有一个 python 包作为 .tar.gz。一段时间以来,我一直在毫无错误地使用 pip 6.1.1。安装包 pip install mypackage.tar.gz 时,distutils 确保将包中的某些文件放入此 /var/www/myfolder 位置。

Pip 6.1.1 和 Pip 1.2.1 正确遵循此行为,但 pip 7.0.1 没有。 Pip 7.0.1 根本不会移动 "myfolder" 目录中的文件。

起初我认为这是一个 distutils 问题,但现在我意识到 mypackage.tar.gz 不会将文件移动到 /var/www/myfolder 位置的唯一情况是安装它时pip withversion 7.0.1 我断定这是一个 pip 问题。

我在 pip 版本之间的更改文档中没有发现任何重要的内容,但我不确定我在寻找什么。

知道会发生什么吗?

请注意,这不是权限问题,因为我 运行 使用 sudo 执行 pip 命令。

从版本 7.0.0 开始,pip 从 sdists 构建轮子并安装这些轮子,而不是直接从 sdists 安装。在从 wheel 安装和从 sdist 安装之间,data_files 的安装位置存在已知差异。引用自 Packaging and Distributing Projects:

setuptools allows absolute “data_files” paths, and pip honors them as absolute, when installing from sdist. This is not true when installing from wheel distributions. Wheels don’t support absolute paths, and they end up being installed relative to “site-packages”. For discussion see wheel Issue #92.

另请参阅:

轮子 第 92 期:bdist_wheel makes absolute data_files relative to site-packages
PyPI 元数据格式 第 13 期:Add a new subdirectory to allow wheels to bypass installation schemes
Python打包用户指南拉212:Fix section on data_files
Ionel Cristian Mărieş 的演讲 - Less known packaging features and tricks