From a65ff69fd3ffeebe74ff79a9ed02bcf52c4c8715 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 29 Mar 2018 03:33:25 -0400 Subject: [PATCH] exclude samples & tests from install There's no value in installing the sample modules (plus they pollute the global samples.* namespace), nor in installing the unittests. For the samples, we set the include option with find_packages so the code only searches the top level apitools dir. For the tests, because they live alongside modules vs a completely sep tree (which is fine), we have to add a series of globs to the exclude_package_data to filter them out. --- setup.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c0ab0b84..856192a6 100644 --- a/setup.py +++ b/setup.py @@ -68,7 +68,7 @@ author='Craig Citro', author_email='craigcitro@google.com', # Contained modules and scripts. - packages=setuptools.find_packages(), + packages=setuptools.find_packages(include=['apitools']), entry_points={'console_scripts': CONSOLE_SCRIPTS}, install_requires=REQUIRED_PACKAGES, tests_require=REQUIRED_PACKAGES + CLI_PACKAGES + TESTING_PACKAGES, @@ -81,6 +81,15 @@ package_data={ 'apitools.data': ['*'], }, + exclude_package_data={ + '': [ + '*_test.py', + '*/testing/*', + '*/testdata/*', + 'base/protorpclite/test_util.py', + 'gen/test_utils.py', + ], + }, # PyPI package information. classifiers=[ 'License :: OSI Approved :: Apache Software License',