MCPcopy Create free account
hub / github.com/numpy/numpy / dist_info

Method dist_info

numpy/distutils/ccompiler_opt.py:642–677  ·  view source on GitHub ↗

Return a tuple containing info about (platform, compiler, extra_args), required by the abstract class '_CCompiler' for discovering the platform environment. This is also used as a cache factor in order to detect any changes happening from outside.

(self)

Source from the content-addressed store, hash-verified

640 return test
641
642 def dist_info(self):
643 """
644 Return a tuple containing info about (platform, compiler, extra_args),
645 required by the abstract class '_CCompiler' for discovering the
646 platform environment. This is also used as a cache factor in order
647 to detect any changes happening from outside.
648 """
649 if hasattr(self, "_dist_info"):
650 return self._dist_info
651
652 cc_type = getattr(self._ccompiler, "compiler_type", '')
653 if cc_type in ("intelem", "intelemw"):
654 platform = "x86_64"
655 elif cc_type in ("intel", "intelw", "intele"):
656 platform = "x86"
657 else:
658 from distutils.util import get_platform
659 platform = get_platform()
660
661 cc_info = getattr(self._ccompiler, "compiler", getattr(self._ccompiler, "compiler_so", ''))
662 if not cc_type or cc_type == "unix":
663 if hasattr(cc_info, "__iter__"):
664 compiler = cc_info[0]
665 else:
666 compiler = str(cc_info)
667 else:
668 compiler = cc_type
669
670 if hasattr(cc_info, "__iter__") and len(cc_info) > 1:
671 extra_args = ' '.join(cc_info[1:])
672 else:
673 extra_args = os.environ.get("CFLAGS", "")
674 extra_args += os.environ.get("CPPFLAGS", "")
675
676 self._dist_info = (platform, compiler, extra_args)
677 return self._dist_info
678
679 @staticmethod
680 def dist_error(*args):

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 2

joinMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected