Why find_packages(exclude=xxx) does not work when doing setup.py sdist?

自闭症网瘾萝莉.ら 提交于 2020-01-13 13:14:21

问题


I am packaging my source code, but I do not want to include tests and docs because it will be too big.

To do that I include in my setup.py:

setup(...
      packages=find_packages(exclude=['tests.*','tests','docs.*','docs']),
      ...
)

When doing a

python setup.py sdist

I can see that my root tests/ and docs/ dirs and everything inside are still included in the generated distribution.

It seems that only

python setup.py bdist

is sensible to the exclude parameter.

Why ? is it possible to exclude dirs for 'setup.py sdist' ?


回答1:


I solved the problem by removing the *.egg-info/ directory : it seems that this directory memorized some older settings...



来源:https://stackoverflow.com/questions/48903470/why-find-packagesexclude-xxx-does-not-work-when-doing-setup-py-sdist

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!