为什么在执行 setup.py sdist 时 find_packages(exclude=xxx) 不起作用? [英] Why find_packages(exclude=xxx) does not work when doing setup.py sdist?
问题描述
我正在打包我的源代码,但我不想包含测试和文档,因为它们太大了.
I am packaging my source code, but I do not want to include tests and docs because it will be too big.
为此,我将其包含在 setup.py 中:
To do that I include in my setup.py:
setup(...
packages=find_packages(exclude=['tests.*','tests','docs.*','docs']),
...
)
当做一个
python setup.py sdist
我可以看到我的 root tests/和 docs/目录以及里面的所有内容仍然包含在生成的分发中.
I can see that my root tests/ and docs/ dirs and everything inside are still included in the generated distribution.
好像只有
python setup.py bdist
对 exclude 参数是明智的.
is sensible to the exclude parameter.
为什么?是否可以排除setup.py sdist"的目录?
Why ? is it possible to exclude dirs for 'setup.py sdist' ?
推荐答案
我通过删除 *.egg-info/目录解决了这个问题:这个目录似乎记住了一些旧的设置...
I solved the problem by removing the *.egg-info/ directory : it seems that this directory memorized some older settings...
这篇关于为什么在执行 setup.py sdist 时 find_packages(exclude=xxx) 不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!