setuptools何时安装到/.../my_module/build/lib/的可编辑链接,何时链接到/.../my_module? [英] When does setuptools install editable link to /.../my_module/build/lib/ andwhen does it link to /.../my_module?
问题描述
我注意到,当我执行可编辑的安装(pip install --user -e .
)时,有时setuptools会创建一个build
目录,并链接到/.../my_module/build/lib
的鸡蛋.
有时(如果我在另一个项目中执行此操作),它不会创建此目录,而只是鸡蛋链接到/.../my_module
I noticed that when I do an editable install (pip install --user -e .
), sometimes, setuptools make a build
directory and egg-links to /.../my_module/build/lib
.
While sometimes (if I do it in another project), it does not create this directory and simply egg-links to /.../my_module
但是,我不知道为什么.在第一种情况下,该项目实际上是不可编辑的(因为它似乎是在构建软件包,并链接到构建版本)
However, I can't figure out why. In the first case, the project is not really editable (since it seems to build the package, and link to the build version)
是什么导致安装程序工具使用build/lib
而不是package dev目录?
What does cause setup tools to use build/lib
rather than the package dev directory ?
(注意:这些是打算与sdist一起分发的完整python项目)
(Note : these are full python projects that are intended to be distributed with sdist)
推荐答案
在setup.py
中指定了构建步骤时,似乎会自动调用setuptools build_py
命令,典型示例是use_2to3=True
.然后,由于您每次都需要重建,因此可编辑"在某种意义上不会得到尊重".
The setuptools build_py
command seems to be automatically called when there is a build step specified int the setup.py
, typical example is use_2to3=True
. Then, the "editable" is not "respected" in a way, since you need to rebuild each time.
这篇关于setuptools何时安装到/.../my_module/build/lib/的可编辑链接,何时链接到/.../my_module?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!