提交 be222f0c authored 作者: Brandon T. Willard's avatar Brandon T. Willard 提交者: Brandon T. Willard

Remove references to numpy.distutils

上级 ef7d8bb8
...@@ -21,7 +21,7 @@ import warnings ...@@ -21,7 +21,7 @@ import warnings
from io import BytesIO, StringIO from io import BytesIO, StringIO
from typing import Callable, Dict, List, Optional, Set, Tuple, cast from typing import Callable, Dict, List, Optional, Set, Tuple, cast
import numpy.distutils import numpy as np
from setuptools._distutils.sysconfig import ( from setuptools._distutils.sysconfig import (
get_config_h_filename, get_config_h_filename,
get_config_var, get_config_var,
...@@ -1670,7 +1670,7 @@ def get_gcc_shared_library_arg(): ...@@ -1670,7 +1670,7 @@ def get_gcc_shared_library_arg():
def std_include_dirs(): def std_include_dirs():
numpy_inc_dirs = numpy.distutils.misc_util.get_numpy_include_dirs() numpy_inc_dirs = [np.get_include()]
py_inc = get_python_inc() py_inc = get_python_inc()
py_plat_spec_inc = get_python_inc(plat_specific=True) py_plat_spec_inc = get_python_inc(plat_specific=True)
python_inc_dirs = ( python_inc_dirs = (
...@@ -2705,27 +2705,9 @@ def default_blas_ldflags(): ...@@ -2705,27 +2705,9 @@ def default_blas_ldflags():
str str
""" """
import numpy.distutils # noqa
warn_record = [] warn_record = []
try: try:
# We do this import only here, as in some setup, if we blas_info = np.__config__.get_info("blas_opt")
# just import aesara and exit, with the import at global
# scope, we get this error at exit: "Exception TypeError:
# "'NoneType' object is not callable" in <bound method
# Popen.__del__ of <subprocess.Popen object at 0x21359d0>>
# ignored"
# This happen with Python 2.7.3 |EPD 7.3-1 and numpy 1.8.1
# isort: off
import numpy.distutils.system_info # noqa
# We need to catch warnings as in some cases NumPy print
# stuff that we don't want the user to see.
# I'm not able to remove all printed stuff
with warnings.catch_warnings(record=True):
numpy.distutils.system_info.system_info.verbosity = 0
blas_info = numpy.distutils.system_info.get_info("blas_opt")
# If we are in a EPD installation, mkl is available # If we are in a EPD installation, mkl is available
if "EPD" in sys.version: if "EPD" in sys.version:
......
...@@ -130,11 +130,10 @@ import os ...@@ -130,11 +130,10 @@ import os
import time import time
import numpy as np import numpy as np
import numpy.distutils
try: try:
import numpy.distutils.__config__ # noqa import numpy.__config__ # noqa
except ImportError: except ImportError:
pass pass
......
...@@ -150,7 +150,7 @@ How do I configure/test my BLAS library ...@@ -150,7 +150,7 @@ How do I configure/test my BLAS library
There are many ways to configure BLAS for Aesara. This is done with the Aesara There are many ways to configure BLAS for Aesara. This is done with the Aesara
flags ``blas__ldflags`` (:ref:`libdoc_config`). The default is to use the BLAS flags ``blas__ldflags`` (:ref:`libdoc_config`). The default is to use the BLAS
installation information in NumPy, accessible via installation information in NumPy, accessible via
``numpy.distutils.__config__.show()``. You can tell aesara to use a different ``numpy.__config__.show()``. You can tell aesara to use a different
version of BLAS, in case you did not compile NumPy with a fast BLAS or if NumPy version of BLAS, in case you did not compile NumPy with a fast BLAS or if NumPy
was compiled with a static library of BLAS (the latter is not supported in was compiled with a static library of BLAS (the latter is not supported in
Aesara). Aesara).
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论