summaryrefslogtreecommitdiff
path: root/numpy/random/_examples/cython/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/random/_examples/cython/setup.py')
-rw-r--r--numpy/random/_examples/cython/setup.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/numpy/random/_examples/cython/setup.py b/numpy/random/_examples/cython/setup.py
new file mode 100644
index 000000000..315527a2d
--- /dev/null
+++ b/numpy/random/_examples/cython/setup.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+"""
+Build the demos
+
+Usage: python setup.py build_ext -i
+"""
+
+import numpy as np
+from distutils.core import setup
+from Cython.Build import cythonize
+from setuptools.extension import Extension
+from os.path import join, abspath, dirname
+
+curpath = abspath(dirname(__file__))
+
+extending = Extension("extending",
+ sources=[join(curpath, 'extending.pyx')],
+ include_dirs=[
+ np.get_include(),
+ join(curpath, '..', '..')
+ ],
+ )
+distributions = Extension("extending_distributions",
+ sources=[join(curpath, 'extending_distributions.pyx'),
+ ],
+ include_dirs=[np.get_include()])
+
+extensions = [extending, distributions]
+
+setup(
+ ext_modules=cythonize(extensions)
+)