When does setuptools install editable link to /…/m

2019-07-27 12:06发布

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)

What does cause setup tools to use build/lib rather than the package dev directory ?

(Note : these are full python projects that are intended to be distributed with sdist)

2条回答
孤傲高冷的网名
2楼-- · 2019-07-27 12:21

as far as I understand you, in order to use a third-party module without installing it, just in the same place where your program is located, create a new directory, put the __ init __.py file and copy the third-party module there. And then you can in your code address it like this

查看更多
Evening l夕情丶
3楼-- · 2019-07-27 12:23

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.

查看更多
登录 后发表回答