I have been fiddling with the MANIFEST.IN file and setup parameters package_data and data_files (both distutils and setuptools) for hours, and I can't figure out how to include data files when building and installing a python package. I managed to get some results when I run python setup.py sdist, but not with python setup.py install --user and not with pip install . --user.
Let's consider the following simple package structure:
mypackage/
    mymodule/
        __init__.py
        gui.py
    data/
        icons/
            icon1.png
    MANIFEST.in
    setup.py
What should I put in setup.py and MANIFEST.in to have data/icons/icon1.png copied in my build and install directories?
I would prefer an opt-in solution (declare all files that must be included).
EDIT:
It turns out I can make it work when I use python setup.py install --user, using data_files parameter in setup(). The problem is with pip install . --user, which is the preffered way of installing my software. I find this strange, I always thought pip install was roughly doing the same thing as python setup.py install. 
