import setuptools EXCLUDED_PACKAGES = ["test", "tests"] PACKAGES = setuptools.find_packages(exclude=EXCLUDED_PACKAGES) setuptools.setup(packages=PACKAGES)