setup.py bdist_egg is not putting files into the egg
Question: I have a confusing issue with python packaging

I have a setup.py that looks like this:

    
    
    import os
    
    try:
        from setuptools import setup
    except ImportError:
        from ez_setup import use_setuptools
        use_setuptools()
        from setuptools import setup
    
    config = {
        "name": "mypackage",
        "version": "3.0.15",
        "include_package_data": True,
        "scripts": ["something.py"],
        "entry_points": {},
        "zip_safe": False,
        }
    
    setup(**config)
    

and a `MANIFEST.in` that looks like:

    
    
    recursive-include mypackage *.*
    recursive-exclude mypackage *.pyc .DS_Store
    

If I do `python setup.py sdist` a tar.gz file is written which contains all
the right files

If I do `python setup.py bdist_egg` and then extract the contents of the egg
using Stuffit Expander... I see a `scripts/something.py` file but none of the
`mypackage` source files.

However in the extracted egg `SOURCES.txt` the `mypackage` files are listed,
so it seems like the minifest has been parsed, it just hasn't put them into
the egg.

What am I misunderstanding/doing wrong?


Answer: You'll need to list files to include in your binary distribution in the
[`package_data`
entry](https://docs.python.org/2/distutils/setupscript.html#distutils-
installing-package-data) to `setuptools.setup()`:

    
    
    config = {
        "name": "mypackage",
        "version": "3.0.15",
        "include_package_data": True,
        "scripts": ["something.py"],
        "entry_points": {},
        "package_data": {'': ['*.ext1', '*.ext2']},
        "zip_safe": False,
        }
    

