title: How to add package data recursively in Python setup.py?
body: <p>I have a new library that has to include a lot of subfolders of small datafiles, and I'm trying to add them as package data.  Imagine I have my library as so:</p>
  
  <pre><code> library
      - foo.py
      - bar.py
   data
     subfolderA
        subfolderA1
        subfolderA2
     subfolderB
        subfolderB1 
        ...
  </code></pre>
  
  <p>I want to add all of the data in all of the subfolders through setup.py, but it seems like I manually have to go into every single subfolder (there are 100 or so) and add an <strong>init</strong>.py file.  Furthermore, will setup.py find these files recursively, or do I need to manually add all of these in setup.py like:</p>
  
  <pre><code>package_data={
    'mypackage.data.folderA': ['*'],
    'mypackage.data.folderA.subfolderA1': ['*'],
    'mypackage.data.folderA.subfolderA2': ['*']
     },
  </code></pre>
  
  <p>I can do this with a script, but seems like a super pain.  How can I achieve this in setup.py?</p>
  
  <p>PS, the hierarchy of these folders is important because this is a database of material files and we want the file tree to be preserved when we present them in a GUI to the user, so it would be to our advantage to keep this file structure intact.</p>