Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support showing the complete C code in the annotated html-file (GH-2858)
- Loading branch information
Showing
12 changed files
with
188 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
PYTHON setup.py build_ext --inplace | ||
PYTHON -c "import not_annotated; not_annotated.check()" | ||
PYTHON -c "import default_annotated; default_annotated.check()" | ||
PYTHON -c "import fullc_annotated; fullc_annotated.check()" | ||
######## setup.py ######## | ||
|
||
from Cython.Build.Dependencies import cythonize | ||
|
||
from distutils.core import setup | ||
|
||
setup( | ||
ext_modules = cythonize(["not_annotated.pyx"], language_level=3) + | ||
cythonize(["default_annotated.pyx"], annotate=True, language_level=3) + | ||
cythonize(["fullc_annotated.pyx"], annotate='fullc', language_level=3) | ||
) | ||
######## not_annotated.pyx ######## | ||
# check that html-file doesn't exist: | ||
def check(): | ||
import os.path as os_path | ||
assert not os_path.isfile(__name__+'.html') | ||
|
||
|
||
|
||
######## default_annotated.pyx ######## | ||
# load html-site and check that the marker isn't 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 not in html) # per default no complete c code | ||
|
||
|
||
|
||
######## 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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters