I do not understand behavior of setuptools well.
I have tiny package with some amount of static files generated in fly, using internally Flask framework, for a simple temporary web server. Everything works pretty well locally. I have managed to get setup.py script to work with overloading build command and adding few lines. And now when I use: python setup.py install or build, everything works fine. My static files are copied to the right directories inside virtualenv: env/lib/python3.4/site-packages/mypackage, also file MyPackage-0.0.1-py3.4.egg-info is generated, and everything just works.
But now I realized that i need/want functionality of 'install_requires', 'setup_requires', 'test_requires', and need to replace my from disutils.core import setup to from setuptools import setup and at that point everything stop working. Instead of coping my static files, setuptools is constructing big binary egg file with everything inside. setup.py stdout is telling me that my files actually are inside, scrolling the binary file in vim also gives me confidence that my files are inside. But neither my scripts or Flask core cannot read them. The open function with given right (I think) path throwing NotADirectoryError poiting at env/lib/python3.4/site-packages/MyPackage-0.0.1-py3.4.egg/mypackage/static/file.txt. I understand that giving such path should automagicaly unpack egg file and give me content. I can understand my lack of experience, but Flask core is trying to do exactly same thing and fails exactly at the same point. So the question is what am I doing wrong ? When I switch back to the distutils.core everything works again.
I understand that this is how setuptools works, but being unable to access my static files is not what I desired. I can write workaround for my code, and unpack files in fly, but I do not thing this is the right way. Additionally I probably wont be able to write workarounds for every external package that use my static files (e.g. Flask here).
I would be grateful for any suggestions, links or tips. I have tried to read distutils and setuptools source files and find some configuration options, but I do not want end user to be forced to install my package with non standard way. What I want to achieve is to type 'python setup.py install' and hide everything inside of my package.
You have two options:
zip_safe=False
keyword argument