Cython Numpy warning about NPY_NO_DEPRECATED_API when using MemoryView Cython Numpy warning about NPY_NO_DEPRECATED_API when using MemoryView numpy numpy

Cython Numpy warning about NPY_NO_DEPRECATED_API when using MemoryView


Just for a further reference, cython online docs says this is because Cython is using a deprecated Numpy API, and for the time being, it's just a warning that we can ignore.


Assuming one wishes to hide the deprecation warning, the following compiler flag can be implemented with clang: extra_compile_args=['-Wno-#warnings'].

For gcc, extra_compile_args=['-Wno-cpp'] achieves the same.

Of course this also hides other preprocessor directive warnings.


I also get the same warnings, and I'd say it's normal.

With the numpy C API you need to put a line in front of the C script if you don't like this warning, but all it does is tell the compiler to ignore the "deprecated" message - it seems to work the same either way.

I'm guessing the Cython compiler doesn't put this line of code when it generates the C code, and I don't think that's important.