summaryrefslogtreecommitdiff
path: root/tests/compile/find_pxd.srctree
blob: 75d2765c95b0657f8f07f601dd7c1679f0ebfb10 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
PYTHON setup.py build_ext --inplace

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

from Cython.Build import cythonize
from Cython.Distutils.extension import Extension

import sys
sys.path.insert(0, "path")

ext_modules = [
    Extension("a", ["a.pyx"]),
    Extension("b", ["b.pyx"]),
    Extension("c", ["c.pyx"]),
    Extension("d", ["d.pyx"]),
]

ext_modules = cythonize(ext_modules, include_path=["include"])


######## a.pyx ########
# Implicit cimport looking in include_path
cdef my_type foo

######## include/a.pxd ########
ctypedef int my_type

######## b.pyx ########
# Explicit cimport looking in sys.path
from b cimport *
cdef my_type foo

######## path/b.pxd ########
ctypedef int my_type

######## c.pyx ########
# Implicit cimport NOT looking in sys.path

######## path/c.pxd ########
+++syntax error just to show that this file is not actually cimported+++

######## path/numpy/__init__.pxd ########

# gh-2905: This should be found before Cython/Inlude/numpy/__init__.pxd

ctypedef int my_type

######## d.pyx ########

cimport numpy

cdef numpy.my_type foo