Skip to content

Commit

Permalink
exclude samples & tests from install
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vapier committed Mar 29, 2018
1 parent fd4a7b7 commit a65ff69
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
author='Craig Citro',
author_email='[email protected]',
# 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,
Expand All @@ -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',
Expand Down

0 comments on commit a65ff69

Please sign in to comment.