summaryrefslogtreecommitdiff
path: root/tests/build/cythonize_with_annotate_via_Options.srctree
blob: f08875506d84808738fb3a473f3881c808dde300 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
PYTHON setup.py build_ext --inplace
PYTHON -c "import fullc_annotated; fullc_annotated.check()"

######## setup.py ########

from Cython.Build.Dependencies import cythonize
from Cython.Compiler import Options

Options.annotate = 'fullc'

from distutils.core import setup

setup(
  ext_modules = cythonize(["fullc_annotated.pyx"], language_level=3)
)

######## fullc_annotated.pyx ########
# load html-site and check that the marker is there:

def check():
    from codecs import open
    with open(__name__+'.html', 'r', 'utf8') as html_file:
        html = html_file.read()

    from Cython.Compiler.Annotate import AnnotationCCodeWriter
    assert (AnnotationCCodeWriter.COMPLETE_CODE_TITLE in html)