title: How do you add additional files to a wheel?
body: <p>How do control what files are included in a wheel?  It appears <code>MANIFEST.in</code> isn't used by <code>python setup.py bdist_wheel</code>.</p>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p>I was wrong about the difference between installing from a source tarball vs a wheel.  The source distribution includes files specified in <code>MANIFEST.in</code>, but the installed package only has python files.  Steps are needed to identify additional files that should be installed, whether the install is via source distribution, egg, or wheel.  Namely, <a href="https://docs.python.org/2/distutils/setupscript.html#installing-package-data">package_data</a> is needed for additional package files, and <a href="https://docs.python.org/2/distutils/setupscript.html#installing-additional-files">data_files</a> for files outside your package like command line scripts or system config files.</p>
  
  <h2>Original Question</h2>
  
  <p>I have <a href="https://github.com/tulsawebdevs/django-multi-gtfs">a project</a> where I've been using <code>python setup.py sdist</code> to build my package, <code>MANIFEST.in</code> to control the files included and excluded, and <a href="https://pypi.python.org/pypi/pyroma">pyroma</a> and <a href="https://pypi.python.org/pypi/check-manifest">check-manifest</a> to confirm my settings.</p>
  
  <p>I recently converted it to dual Python 2 / 3 code, and added a setup.cfg with</p>
  
  <pre><code>[bdist_wheel]
  universal = 1
  </code></pre>
  
  <p>I can build a wheel with <code>python setup.py bdist_wheel</code>, and it appears to be a universal wheel as desired.  However, it doesn't include all of the files specified in <code>MANIFEST.in</code>.  </p>
  
  <h2>What gets installed?</h2>
  
  <p>I dug deeper, and now know more about packaging and wheel.  Here's what I learned:</p>
  
  <p>I upload two package files to the <a href="https://pypi.python.org/pypi/multigtfs/0.4.2">multigtfs project on PyPi</a>:</p>
  
  <ul>
  <li><code>multigtfs-0.4.2.tar.gz</code> - the source tar ball, which includes all the files in <code>MANIFEST.in</code>.</li>
  <li><code>multigtfs-0.4.2-py2.py3-none-any.whl</code> - The binary distribution in question.</li>
  </ul>
  
  <p>I created two new virtual environments, both with Python 2.7.5, and installed each package (<code>pip install multigtfs-0.4.2.tar.gz</code>).  The two environments are almost identical.  They have different <code>.pyc</code> files, which are the "compiled" Python files.  There are log files which record the different paths on disk.  The install from the source tar ball includes a folder <code>multigtfs-0.4.2-py27.egg-info</code>, detailing the installation, and the wheel install has a <code>multigtfs-0.4.2.dist-info</code> folder, with the details of that process.  However, from the point of view of code using the multigtfs project, there is no difference between the two installation methods.</p>
  
  <p>Explicitly, neither has the .zip files used by my test, so the test suite will fail:</p>
  
  <pre><code>$ django-admin startproject demo
  $ cd demo
  $ pip install psycopg2  # DB driver for PostGIS project
  $ createdb demo         # Create PostgreSQL database
  $ psql -d demo -c "CREATE EXTENSION postgis" # Make it a PostGIS database 
  $ vi demo/settings.py   # Add multigtfs to INSTALLED_APPS,
                          # Update DATABASE to set ENGINE to django.contrib.gis.db.backends.postgis
                          # Update DATABASE to set NAME to test
  $ ./manage.py test multigtfs.tests  # Run the tests
  ...
  IOError: [Errno 2] No such file or directory: u'/Users/john/.virtualenvs/test/lib/python2.7/site-packages/multigtfs/tests/fixtures/test3.zip'
  </code></pre>
  
  <h2>Specifying additional files</h2>
  
  <p>Using the suggestions from the answers, I added some additional directives to <code>setup.py</code>:</p>
  
  <pre><code>from __future__ import unicode_literals
  # setup.py now requires some funky binary strings
  ...
  setup(
      name='multigtfs',
      packages=find_packages(),
      package_data={b'multigtfs': ['test/fixtures/*.zip']},
      include_package_data=True,
      ...
  )
  </code></pre>
  
  <p>This installs the zip files (as well as the README) to the folder, and tests now run correctly.  Thanks for the suggestions!</p>