summaryrefslogtreecommitdiff
path: root/numpy/random/_examples/cython/setup.py
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@gmail.com>2022-09-11 16:46:39 +0300
committerRalf Gommers <ralf.gommers@gmail.com>2022-09-11 16:46:39 +0300
commit8c0e2bc4746417269c9cca105c729a08a0349a7e (patch)
tree888d2549439f52ff78dbdfaaa227962e60bf2736 /numpy/random/_examples/cython/setup.py
parent151c18486ef04d97bedb7a1b9f88cea5b75ce816 (diff)
downloadnumpy-8c0e2bc4746417269c9cca105c729a08a0349a7e.tar.gz
MAINT: random: remove `get_info` from "extending with Cython" example
xref gh-21431
Diffstat (limited to 'numpy/random/_examples/cython/setup.py')
-rw-r--r--numpy/random/_examples/cython/setup.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/numpy/random/_examples/cython/setup.py b/numpy/random/_examples/cython/setup.py
index f41150fdb..e70a1fddc 100644
--- a/numpy/random/_examples/cython/setup.py
+++ b/numpy/random/_examples/cython/setup.py
@@ -4,21 +4,24 @@ Build the Cython demonstrations of low-level access to NumPy random
Usage: python setup.py build_ext -i
"""
-import setuptools # triggers monkeypatching distutils
-from distutils.core import setup
from os.path import dirname, join, abspath
+from setuptools import setup
+from setuptools.extension import Extension
+
import numpy as np
from Cython.Build import cythonize
-from numpy.distutils.misc_util import get_info
-from setuptools.extension import Extension
+
path = dirname(__file__)
src_dir = join(dirname(path), '..', 'src')
defs = [('NPY_NO_DEPRECATED_API', 0)]
inc_path = np.get_include()
-lib_path = [abspath(join(np.get_include(), '..', '..', 'random', 'lib'))]
-lib_path += get_info('npymath')['library_dirs']
+# Add paths for npyrandom and npymath libraries:
+lib_path = [
+ abspath(join(np.get_include(), '..', '..', 'random', 'lib')),
+ abspath(join(np.get_include(), '..', 'lib'))
+]
extending = Extension("extending",
sources=[join('.', 'extending.pyx')],