Use the find_packages()
function:
from setuptools import setup, find_packages
setup(
# ...
packages=find_packages(),
)
The function will search for python packages (directories with a __init__.py
file) and return these as a properly formatted list. It'll start in the same dir as the setup.py script but can be given an explicit starting directory instead, as well as exclusion patterns if you need it to skip some things.