Basically my python package is setup like:
module
\\_examples
\\_folder1
\\_file1.py
\\_file2.py
\\_folder2
\\_file1.py
\\_file2.py
None of the suggested answers worked for me in a similar situation.
I needed to make a distribution with my package, which included several sub-modules in a sub-directory, so that these were the files I needed to go into sdist:
ipyexperiments/*py
ipyexperiments/utils/*py
and no matter what I tried, the subdir utils's modules were not getting included in sdist.
What worked for me is leaving config.py's default:
# config.py
from setuptools import setup, find_packages
[...]
setup(
packages = find_packages(),
[...]
)
but adding to MANIFEST.in:
# MANIFEST.in
graft ipyexperiments
and everything under ipyexperiments was included.
If you don't already have MANIFEST.in, create it at the same directory as config.py.
I also added to MANIFEST.in
prune tests
global-exclude *.py[co]
to exclude all of tests directory and any unwanted *pyc and *.pyo files anywhere.