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?
A source distribution, or more commonly sdist, is a distribution that contains all of the python source code (i.e. . py files), any data files that the library requires, and a setup.py file which describes to the setuptools module how your python code should be packaged.
Setuptools is a collection of enhancements to the Python distutils that allow developers to more easily build and distribute Python packages, especially ones that have dependencies on other packages. Packages built and distributed using setuptools look to the user like ordinary Python packages based on the distutils .
The MANIFEST.in file contains commands that allow you to discover and manipulate lists of files. There are many commands that can be used with different objectives, but you should try to not make your MANIFEST.in file too fine grained.
A MANIFEST.in file consists of commands, one per line, instructing setuptools to add or remove some set of files from the sdist.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With