When describing a python package in setup.py
in distutils
in Python, is there a way to make it so automatically get every directory that has a __init__.py
in it and include that as a subpackage?
ie if the structure is:
mypackage/__init__.py
mypackage/a/__init__.py
mypackage/b/__init__.py
I want to avoid doing:
packages = ['mypackage', 'mypackage.a', 'mypackage.b']
and instead just do:
packages = ['mypackage']
and have it automatically find things like a
and b
since they have an init file. thanks.
I would recommend using the find_packages() function available with setuptools such as:
from setuptools import setup, find_packages
and then do
packages=find_packages()