__init__.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. from __future__ import division, absolute_import, print_function
  2. from .__version__ import version as __version__
  3. # Must import local ccompiler ASAP in order to get
  4. # customized CCompiler.spawn effective.
  5. from . import ccompiler
  6. from . import unixccompiler
  7. from .info import __doc__
  8. from .npy_pkg_config import *
  9. # If numpy is installed, add distutils.test()
  10. try:
  11. from . import __config__
  12. # Normally numpy is installed if the above import works, but an interrupted
  13. # in-place build could also have left a __config__.py. In that case the
  14. # next import may still fail, so keep it inside the try block.
  15. from numpy._pytesttester import PytestTester
  16. test = PytestTester(__name__)
  17. del PytestTester
  18. except ImportError:
  19. pass
  20. def customized_fcompiler(plat=None, compiler=None):
  21. from numpy.distutils.fcompiler import new_fcompiler
  22. c = new_fcompiler(plat=plat, compiler=compiler)
  23. c.customize()
  24. return c
  25. def customized_ccompiler(plat=None, compiler=None):
  26. c = ccompiler.new_compiler(plat=plat, compiler=compiler)
  27. c.customize('')
  28. return c