Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

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' ?

like image 649
Eric Avatar asked Feb 21 '18 10:02

Eric


1 Answers

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

like image 188
Eric Avatar answered Nov 15 '22 07:11

Eric