Repository: pandas-dev/pandas

Issue:
Leveraging find_packages in setup.py
Right now when creating new folders we have to also list them as packages in the setup.py file. Is there any reason why we have not considered using find_packages as suggested by the [Python Packaging User Guide](https://packaging.python.org/tutorials/distributing-packages/#packages) to take care of that? 

Happy to submit a PR just not an expert on packaging, so wanted to discuss what if any caveats are out there first before making any changes


Discussion:
no we should switch to find_packages

it didn’t exist in older setup tools (in theory we should have a min in setup tools but it can be pretty loose)

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,7 @@
 import sys
 import shutil
 from distutils.version import LooseVersion
-from setuptools import setup, Command
+from setuptools import setup, Command, find_packages
 
 # versioning
 import versioneer
@@ -716,100 +716,12 @@ def pxd(name):
 setup(name=DISTNAME,
       maintainer=AUTHOR,
       version=versioneer.get_version(),
-      packages=['pandas',
-                'pandas.api',
-                'pandas.api.types',
-                'pandas.compat',
-                'pandas.compat.numpy',
-                'pandas.core',
-                'pandas.core.dtypes',
-                'pandas.core.indexes',
-                'pandas.core.computation',
-                'pandas.core.reshape',
-                'pandas.core.sparse',
-                'pandas.core.tools',
-                'pandas.core.util',
-                'pandas.computation',
-                'pandas.errors',
-                'pandas.formats',
-                'pandas.io',
-                'pandas.io.json',
-                'pandas.io.sas',
-                'pandas.io.msgpack',
-                'pandas.io.formats',
-                'pandas.io.clipboard',
-                'pandas._libs',
-                'pandas._libs.tslibs',
-                'pandas.plotting',
-                'pandas.stats',
-                'pandas.types',
-                'pandas.util',
-                'pandas.tests',
-                'pandas.tests.api',
-                'pandas.tests.dtypes',
-                'pandas.tests.categorical',
-                'pandas.tests.computation',
-                'pandas.tests.sparse',
-                'pandas.tests.frame',
-                'pandas.tests.generic',
-                'pandas.tests.indexing',
-                'pandas.tests.indexes',
-                'pandas.tests.indexes.datetimes',
-                'pandas.tests.indexes.timedeltas',
-                'pandas.tests.indexes.period',
-                'pandas.tests.internals',
-                'pandas.tests.io',
-                'pandas.tests.io.json',
-                'pandas.tests.io.parser',
-                'pandas.tests.io.sas',
-                'pandas.tests.io.msgpack',
-                'pandas.tests.io.formats',
-                'pandas.tests.groupby',
-                'pandas.tests.reshape',
-                'pandas.tests.reshape.merge',
-                'pandas.tests.series',
-                'pandas.tests.scalar',
-                'pandas.tests.tseries',
-                'pandas.tests.tseries.offsets',
-                'pandas.tests.plotting',
-                'pandas.tests.tools',
-                'pandas.tests.util',
-                'pandas.tools',
-                'pandas.tseries',
-                ],
-      package_data={'pandas.tests': ['data/*.csv'],
-                    'pandas.tests.indexes': ['data/*.pickle'],
+      packages=find_packages(include=['pandas', 'pandas.*']),
+      package_data={'': ['data/*', 'templates/*'],
                     'pandas.tests.io': ['data/legacy_hdf/*.h5',
                                         'data/legacy_pickle/*/*.pickle',
                                         'data/legacy_msgpack/*/*.msgpack',
-                                        'data/*.csv*',
-                                        'data/*.dta',
-                                        'data/*.pickle',
-                                        'data/*.txt',
-                                        'data/*.xls',
-                                        'data/*.xlsx',
-                                        'data/*.xlsm',
-                                        'data/*.table',
-                                        'parser/data/*.csv',
-                                        'parser/data/*.gz',
-                                        'parser/data/*.bz2',
-                                        'parser/data/*.txt',
-                                        'parser/data/*.tar',
-                                        'parser/data/*.zip',
-                                        'parser/data/*.tar.gz',
-                                        'sas/data/*.csv',
-                                        'sas/data/*.xpt',
-                                        'sas/data/*.sas7bdat',
-                                        'data/*.html',
-                                        'data/html_encoding/*.html',
-                                        'json/data/*.json*'],
-                    'pandas.tests.io.formats': ['data/*.csv'],
-                    'pandas.tests.io.msgpack': ['data/*.mp'],
-                    'pandas.tests.reshape': ['data/*.csv'],
-                    'pandas.tests.reshape.merge': ['data/*.csv'],
-                    'pandas.tests.tseries.offsets': ['data/*.pickle'],
-                    'pandas.io.formats': ['templates/*.tpl']
-                    },
+                                        'data/html_encoding/*.html']},
       ext_modules=extensions,
       maintainer_email=EMAIL,
       description=DESCRIPTION,


Test patch: