There are times where you may need to include non-Python assets in your Python package for distribution. This may include data files or JSON assets from a submodule for example that your Python package needs to reference. By default, Python will not include these assets in the bdist/sdist
. You can either include an empty __init__.py
file in that submodule (even if the project isn't Python) and rely on the magic of packages=setuptools.find_packages()
in setup.py
or you can explicitly include those non-Python assets by using the following steps.
- In
setup.py
, include an array of locations to include. These are glob matching patterns. An example of this looks like the following:
package_data={
'top_level_package': [
'path/to/assets/one/*.json',