| 1 |
PYTHON setup.py build_ext --inplace |
| 2 |
PYTHON -c "import a; import sys; sys.exit(a.compile_env_test())" |
| 3 |
|
| 4 |
######## setup.py ######## |
| 5 |
|
| 6 |
from distutils.core import setup |
| 7 |
from Cython.Distutils.extension import Extension |
| 8 |
from Cython.Distutils.old_build_ext import old_build_ext |
| 9 |
|
| 10 |
setup( |
| 11 |
cmdclass = {'build_ext': old_build_ext}, |
| 12 |
ext_modules = [Extension( |
| 13 |
"a", ["a.pyx"], |
| 14 |
pyrex_compile_time_env = {'TEST': True}, |
| 15 |
)], |
| 16 |
) |
| 17 |
|
| 18 |
######## a.pyx ######## |
| 19 |
def compile_env_test(): |
| 20 |
IF TEST: |
| 21 |
return 0 |
| 22 |
ELSE: |
| 23 |
return 1 |