The problem is well explained here :
Setuptools has many silent crash modes. One of them is to include all the files in the sdist release (well, not entirely unsuccessful, you could have RTFM, but the default behavior is unexpected). This post will serve as a google-yourself-answer for this problem until we get a new, more brilliant one. Distribute all our problems.
As the comments note, the misdesign error is actually located in distutils - setuptools just cannot fix it (if you use svn, everything is actually a little better).
I can reproduce your problem as it is observed, i.e. shorten the file names a bit, I have:
$ ls -lR total 8 -rw-r--r-- 1 aleax eng 0 Oct 24 11:25 __init__.py -rw-r--r-- 1 aleax eng 0 Oct 24 11:25 modu.py drwxr-xr-x 4 aleax eng 136 Oct 24 11:25 mysub -rw-r--r-- 1 aleax eng 323 Oct 24 11:26 setup.py ./mysub: total 0 -rw-r--r-- 1 aleax eng 0 Oct 24 11:25 __init__.py -rw-r--r-- 1 aleax eng 0 Oct 24 11:25 deepmod.py
and running python setup.py sdist produces (as well as warnings):
$ ls -lR total 16 -rw-r--r-- 1 aleax eng 104 Oct 24 11:35 MANIFEST -rw-r--r-- 2 aleax eng 0 Oct 24 11:25 __init__.py drwxr-xr-x 3 aleax eng 102 Oct 24 11:35 dist -rw-r--r-- 2 aleax eng 0 Oct 24 11:25 modu.py drwxr-xr-x 5 aleax eng 170 Oct 24 11:35 mypack drwxr-xr-x 4 aleax eng 136 Oct 24 11:25 mysub -rw-r--r-- 1 aleax eng 323 Oct 24 11:26 setup.py ./dist: total 8 -rw-r--r-- 1 aleax eng 483 Oct 24 11:35 a-0.1.tar.gz ./mypack: total 0 -rw-r--r-- 2 aleax eng 0 Oct 24 11:25 __init__.py -rw-r--r-- 2 aleax eng 0 Oct 24 11:25 modu.py drwxr-xr-x 4 aleax eng 136 Oct 24 11:35 mysub ./mypack/mysub: total 0 -rw-r--r-- 2 aleax eng 0 Oct 24 11:25 __init__.py -rw-r--r-- 2 aleax eng 0 Oct 24 11:25 deepmod.py ./mysub: total 0 -rw-r--r-- 2 aleax eng 0 Oct 24 11:25 __init__.py -rw-r--r-- 2 aleax eng 0 Oct 24 11:25 deepmod.py
One solution is to change the layout of the directory as follows (from the current mypack directory):
$ mkdir mypack $ mv __init__.py modu.py mysub/ mypack $ touch README.txt
it happened:
$ ls -lR total 8 -rw-r--r-- 1 aleax eng 0 Oct 24 11:37 README.txt drwxr-xr-x 5 aleax eng 170 Oct 24 11:37 mypack -rw-r--r-- 1 aleax eng 323 Oct 24 11:26 setup.py ./mypack: total 0 -rw-r--r-- 1 aleax eng 0 Oct 24 11:25 __init__.py -rw-r--r-- 1 aleax eng 0 Oct 24 11:25 modu.py drwxr-xr-x 4 aleax eng 136 Oct 24 11:25 mysub ./mypack/mysub: total 0 -rw-r--r-- 1 aleax eng 0 Oct 24 11:25 __init__.py -rw-r--r-- 1 aleax eng 0 Oct 24 11:25 deepmod.py
(and get rid of one of the warnings, that is, about README - about the missing MANIFEST.in obviously remains ;-). Also change one line of setup.py to:
package_dir={'': '.'},
Now, after python setup.py sdist , you will get a decent archive:
$ tar tvf dist/a-0.1.tar.gz drwxr-xr-x aleax/eng 0 2009-10-24 11:40:05 a-0.1/ drwxr-xr-x aleax/eng 0 2009-10-24 11:40:05 a-0.1/mypack/ -rw-r
the MANIFEST file is still being created in your current directory, but I hope this is not a problem.