Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include empty directory with python setup.py sdist

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?

like image 293
astrofrog Avatar asked Apr 14 '10 19:04

astrofrog


1 Answers

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.

like image 71
nosklo Avatar answered Sep 19 '22 10:09

nosklo