Compile Cython on pip package build
Question: I'm developing a Python package, [EcoPy](https://github.com/Auerilas/ecopy),
that is mostly written in pure Python. The main folder is called ecopy.
There's a subfolder called regression that has a Cython file that's already
been built. The main setup.py file includes the code:

    
    
    ext_modules = cythonize([
        Extension(
            'ecopy.regression.isoFunc', ['ecopy/regression/isoFunc.pyx'], **opts),
    ])
    

When I run

    
    
    sudo pip install ecopy -e . --upgrade --force-reinstall
    

the module builds fine. It even re-compiles the isoFunc.c file if I've deleted
it. The problem is that Cython doesn't then convert the .c file to the .so
file, which I need in order to import the function. If I try loading the
module without it, I get

    
    
    ImportError: No module named isoFunc
    

If I manually setup file using the command line

    
    
    python setup.py build_ext --inplace
    

Cython DOES generate the .so file. How do I get it to generate the .so file
using pip? I've tried to figure out how statsmodels did it by reading their
code, but honestly, its a mystery to me.

It's almost as if the pip command misses the build_ext argument.


Answer: I can answer this question, because I just learned that I'm an idiot.

    
    
    sudo pip install ecopy -e . --upgrade --force-reinstall
    

was using an older version from the PyPI that didn't have the new setup.py
with the Cython code. When I did it correctly

    
    
    sudo pip install -e . --upgrade --force-reinstall
    

and used the latest version on my hard drive, it worked fine.

Little victories.

