13

I am using setuptools to package a custom module for deployment, which should not include certain files in the data/ directory that were used for development. I have succesfully excluded the necessary files using recursive-exclude data/ * in my MANIFEST.in file, but I also see that I could do this via prune data/

Both approaches remove the intended files from package.egg-info/SOURCES.txt after packaging via python setup.py egg_info

Is there any difference between the two?

yunque
  • 625
  • 1
  • 8
  • 18

1 Answers1

16

Based on the documentation behaviour is:

  • recursive-exclude dir pat1 pat2 takes the directory dir and ignores all the files that match patterns pat1 and pat2

  • prune dir will exclude all files within the directory dir

So in your case recursive-exclude dir * and prune dir should have the same behaviour, except that prune will remove the whole directory, whereas recursive-exclude will preserve an empty folder.

jojeck
  • 935
  • 9
  • 29
  • 2
    Ah! I was looking at the setuptools docs rather than distutils... Anyway, `recursive-exclude` seems to get rid of empty folders as well. Looking at the docs, I think the only difference is that `recursive-exclude` allows you to specify file types whereas `prune` removes the entire directory. – yunque Mar 30 '17 at 09:56