title: setuptools: adding additional files outside package
body: <p>I have a <code>python</code> application that has a fixed layout which I cannot change. I would like to wrap it up using setuptools, e.g. write a <code>setup.py</code> script.</p>
  
  <p>Using the official documentation, I was able to write a first template. However, the application in question uses a lot of additional data files that are not explicitly part of any package. Here's an example source tree:</p>
  
  <pre><code>somepackage
     __init__.py
     something.py
     data.txt
  additionalstuff
     moredata.txt
  INFO.txt
  </code></pre>
  
  <p>Here's the trouble: The code in <code>something.py</code>  reads the files <code>moredata.txt</code> and <code>INFO.txt</code>. For the former, I can monkeypatch the problem by adding an empty <code>additionalstuff/__init__.py</code> file to promote <code>additionalstuff</code> to a package and have it picked up by <code>setuptools</code>. But how could I possibly add <code>INFO.txt</code> to my <code>.egg</code>?</p>
  
  <h1>Edit</h1>
  
  <p>The proposed solutions using something along the lines of</p>
  
  <pre><code>package_data = { '' : ['moredata.txt','INFO.txt']}
  </code></pre>
  
  <p>does not work for me because the files <code>moredata</code> and <code>INFO.txt</code> do not belong to a package, but are part of a separate folder that is only part of the module as a whole, not of any individual package. 
  As explained above, this could be fixed in the case of <code>moredata.txt</code> by adding a <code>__init__.py</code> file to <code>additionpythonalstuff</code>, thus promoting it to a package. However, this is not an elegant solution and does not work at all for <code>INFO.txt</code>, which lives in the top-level directory.</p>
  
  <h1>Solution</h1>
  
  <p>Based on the accepted answer, here's the solution</p>
  
  <p>This is the <code>setup.py</code>:</p>
  
  <pre><code>from setuptools import setup, find_packages
  
  setup(
      name='mytest',
      version='1.0.0',
      description='A sample Python project',
      author='Test',
      zip_safe=False,
      author_email='test@test.com',
      keywords='test',
      packages=find_packages(),
      package_data={'': ['INFO.txt', 'moredata.txt'],
                    'somepackage':['data.txt']},
      data_files=[('.',['INFO.txt']),
                  ('additionalstuff',['additionalstuff/moredata.txt'])],
      include_package_data=True,
  )
  </code></pre>
  
  <p>And this is the <code>MANIFEST.in</code>:</p>
  
  <pre><code>include INFO.txt
  graft additionalstuff
  include somepackage/*.txt
  </code></pre>