| 1 |
|
| 2 |
PYTHON setup.py build_ext --inplace --cython-c-in-temp |
| 3 |
PYTHON -c 'import mymodule; assert mymodule.test_string == "TEST"' |
| 4 |
PYTHON check_paths.py |
| 5 |
|
| 6 |
############# setup.py ############# |
| 7 |
|
| 8 |
from Cython.Distutils.extension import Extension |
| 9 |
from Cython.Build import build_ext |
| 10 |
from distutils.core import setup |
| 11 |
|
| 12 |
setup( |
| 13 |
name='Hello world app', |
| 14 |
ext_modules = [ |
| 15 |
Extension( |
| 16 |
name = 'mymodule', |
| 17 |
sources=['mymodule.pyx'], |
| 18 |
) |
| 19 |
], |
| 20 |
cmdclass={'build_ext': build_ext}, |
| 21 |
) |
| 22 |
|
| 23 |
######## mymodule.pyx ######## |
| 24 |
|
| 25 |
test_string = "TEST" |
| 26 |
|
| 27 |
######## check_paths.py ######## |
| 28 |
|
| 29 |
import os |
| 30 |
assert not os.path.exists("mymodule.c") |