| 1 |
PYTHON setup.py build_ext --inplace |
| 2 |
PYTHON -c "import not_annotated; not_annotated.check()" |
| 3 |
PYTHON -c "import default_annotated; default_annotated.check()" |
| 4 |
PYTHON -c "import fullc_annotated; fullc_annotated.check()" |
| 5 |
######## setup.py ######## |
| 6 |
|
| 7 |
from Cython.Build.Dependencies import cythonize |
| 8 |
|
| 9 |
from distutils.core import setup |
| 10 |
|
| 11 |
setup( |
| 12 |
ext_modules = cythonize(["not_annotated.pyx"], language_level=3) + |
| 13 |
cythonize(["default_annotated.pyx"], annotate=True, language_level=3) + |
| 14 |
cythonize(["fullc_annotated.pyx"], annotate='fullc', language_level=3) |
| 15 |
) |
| 16 |
######## not_annotated.pyx ######## |
| 17 |
# check that html-file doesn't exist: |
| 18 |
def check(): |
| 19 |
import os.path as os_path |
| 20 |
assert not os_path.isfile(__name__+'.html') |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
######## default_annotated.pyx ######## |
| 25 |
# load html-site and check that the marker isn't there: |
| 26 |
def check(): |
| 27 |
from codecs import open |
| 28 |
with open(__name__+'.html', 'r', 'utf8') as html_file: |
| 29 |
html = html_file.read() |
| 30 |
|
| 31 |
from Cython.Compiler.Annotate import AnnotationCCodeWriter |
| 32 |
assert (AnnotationCCodeWriter.COMPLETE_CODE_TITLE not in html) # per default no complete c code |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
######## fullc_annotated.pyx ######## |
| 37 |
# load html-site and check that the marker is there: |
| 38 |
def check(): |
| 39 |
from codecs import open |
| 40 |
with open(__name__+'.html', 'r', 'utf8') as html_file: |
| 41 |
html = html_file.read() |
| 42 |
|
| 43 |
from Cython.Compiler.Annotate import AnnotationCCodeWriter |
| 44 |
assert (AnnotationCCodeWriter.COMPLETE_CODE_TITLE in html) |
| 45 |
|