tags:

views:

95

answers:

1

I have a Python package where I want to include an empty directory as part of the source distribution. I tried adding

include empty_directory

to the MANIFEST.in file, but when I run

python setup.py sdist

The empty directory is still not included. Any tips on how to do this?

+1  A: 

According to the docs:

  • include pat1 pat2 - include all files matching any of the listed patterns
  • exclude pat1 pat2 - exclude all files matching any of the listed patterns
  • recursive-include dir pat1 pat2 - include all files under dir matching any of the listed patterns
  • recursive-exclude dir pat1 pat2 - exclude all files under dir matching any of the listed patterns
  • global-include pat1 pat2 - include all files anywhere in the source tree matching — & any of the listed patterns
  • global-exclude pat1 pat2 - exclude all files anywhere in the source tree matching — & any of the listed patterns
  • prune dir - exclude all files under dir
  • graft dir - include all files under dir

So seems like you want graft, not include. Also, it seems you can't include empty directories. You have to create a "empty.txt" file or something like this inside the directory to force its inclusion.

nosklo
This seems to be a common practice with many dist systems. I've seen something like "empty.txt" or DELETE included with a simple note saying "This may be deleted at any time.".
Michael Herold