How to use annotate=True on Cythonize()

Here is what I finally used that now seems to work:

from distutils.core import setup
from Cython.Build import cythonize

import Cython.Compiler.Options
Cython.Compiler.Options.annotate = True

setup(
    ext_modules = cythonize("gpcython.pyx", annotate=True)
)

You can try to remove the generated c or cpp file. If there's no change in pyx, cython won't try to repeat the build. I don't know how cython tracks the build dependencies. I guess it's similar to how make works.