I can remove the docstrings if I invoke cython manually, eg:
cython -D mmod.py
but when I try to use the setup utility, I am unable to pass that -D parameter along.
setup.py
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules = [Extension("mmod", ["mmod.py"])]
setup(
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules
)
This produces a library that has all doc strings available, compared to when running with -D.
Cython compiling option are stored in the module Cython.Compiler.Options
. So what you are looking for is
import Cython.Compiler.Options
Cython.Compiler.Options.docstrings = False
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With