我们从Python开源项目中,提取了以下9个代码示例,用于说明如何使用builtins.__NUMPY_SETUP__。
def include_dirs_hook(): if sys.version_info[0] >= 3: import builtins if hasattr(builtins, '__NUMPY_SETUP__'): del builtins.__NUMPY_SETUP__ import imp import numpy imp.reload(numpy) else: import __builtin__ if hasattr(__builtin__, '__NUMPY_SETUP__'): del __builtin__.__NUMPY_SETUP__ import numpy reload(numpy) ext = Extension('test', []) ext.include_dirs.append(numpy.get_include()) if not has_include_file( ext.include_dirs, os.path.join("numpy", "arrayobject.h")): warnings.warn( "The C headers for numpy could not be found. " "You may need to install the development package") return [numpy.get_include()]
def is_bootstrapping(): if sys.version_info[0] >= 3: import builtins else: import __builtin__ as builtins try: builtins.__NUMPY_SETUP__ return True except AttributeError: return False __NUMPY_SETUP__ = False #########################
def finalize_options(self): global libnumpythia #global external_fastjet _build_ext.finalize_options(self) # Prevent numpy from thinking it is still in its setup process try: del builtins.__NUMPY_SETUP__ except AttributeError: pass import numpy libnumpythia.include_dirs.append(numpy.get_include())