Skip to content

Commit 568e00f

Browse files
committed
Update for Cython 3.x
1 parent 9884a21 commit 568e00f

File tree

6 files changed

+10
-8
lines changed

6 files changed

+10
-8
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pointers_cython.c

source-code/cython/Pointers/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
VERSION = cpython-34m
2-
POINTERS_LIB = pointers.$(VERSION).so
1+
VERSION = cpython-311-x86_64-linux-gnu
2+
CYTHON_LIB = pointers_cython.$(VERSION).so
33

4-
all: $(POINTERS_LIB)
4+
all: $(CYTHON_LIB)
55

6-
$(POINTERS_LIB): pointers.pyx
6+
$(CYTHON_LIB): pointers_cython.pyx
77
python setup.py build_ext --inplace
88

99
clean:
1010
python setup.py clean
11-
rm -f pointers.c $(POINTERS_LIB)
11+
$(RM) pointers_cython.c $(CYTHON_LIB)

source-code/cython/Pointers/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Simple example of using pointers in Cython code.
33

44
## What is it?
5-
1. `pointers.pyx`: code that computes a list of squares using a cdef
5+
1. `pointers_cython.pyx`: code that computes a list of squares using a cdef
66
function that increments an integer value referred to by a pointer.
77
1. `setup.py`: Python build script.
88
1. `Makefile`: make file to build the extension.

source-code/cython/Pointers/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
from Cython.Build import cythonize
55

66
setup(
7-
ext_modules=cythonize('pointers.pyx')
7+
ext_modules=cythonize('pointers_cython.pyx',
8+
language_level='3str')
89
)

source-code/cython/Pointers/squares.py

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
import pointers
3+
import pointers_cython as pointers
44

55

66
print(pointers.squares(5))

0 commit comments

Comments
 (0)