summaryrefslogtreecommitdiff
path: root/Demos/libraries
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2014-10-09 19:30:04 +0200
committerStefan Behnel <stefan_ml@behnel.de>2014-10-09 19:30:04 +0200
commite505c27a25a62544e1646016d4aee6c24a973fd7 (patch)
tree52aa1426b0bd8a1a59e00015e11b84385d2953c6 /Demos/libraries
parent91934c524c6ffc079e1c2c2b919154981d53a52e (diff)
downloadcython-e505c27a25a62544e1646016d4aee6c24a973fd7.tar.gz
fix up demo code
Diffstat (limited to 'Demos/libraries')
-rw-r--r--Demos/libraries/setup.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/Demos/libraries/setup.py b/Demos/libraries/setup.py
index 557f64fa0..01672a475 100644
--- a/Demos/libraries/setup.py
+++ b/Demos/libraries/setup.py
@@ -1,8 +1,9 @@
import os
+import sys
from distutils.core import setup
from distutils.extension import Extension
-from Cython.Distutils import build_ext
+from Cython.Build import cythonize
# For demo purposes, we build our own tiny library.
@@ -12,20 +13,19 @@ try:
assert os.system("ar rcs libmymath.a mymath.o") == 0
except:
if not os.path.exists("libmymath.a"):
- print "Error building external library, please create libmymath.a manually."
+ print("Error building external library, please create libmymath.a manually.")
sys.exit(1)
# Here is how to use the library built above.
-ext_modules=[
+ext_modules = cythonize([
Extension("call_mymath",
- sources = ["call_mymath.pyx"],
- include_dirs = [os.getcwd()], # path to .h file(s)
- library_dirs = [os.getcwd()], # path to .a or .so file(s)
- libraries = ['mymath'])
-]
+ sources=["call_mymath.pyx"],
+ include_dirs=[os.getcwd()], # path to .h file(s)
+ library_dirs=[os.getcwd()], # path to .a or .so file(s)
+ libraries=['mymath'])
+])
setup(
- name = 'Demos',
- cmdclass = {'build_ext': build_ext},
- ext_modules = ext_modules,
+ name='Demos',
+ ext_modules=ext_modules,
)