__config__.py 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. # This file is generated by SciPy's build process
  2. # It contains system_info results at the time of building this package.
  3. from enum import Enum
  4. __all__ = ["show"]
  5. _built_with_meson = True
  6. class DisplayModes(Enum):
  7. stdout = "stdout"
  8. dicts = "dicts"
  9. def _cleanup(d):
  10. """
  11. Removes empty values in a `dict` recursively
  12. This ensures we remove values that Meson could not provide to CONFIG
  13. """
  14. if isinstance(d, dict):
  15. return { k: _cleanup(v) for k, v in d.items() if v != '' and _cleanup(v) != '' }
  16. else:
  17. return d
  18. CONFIG = _cleanup(
  19. {
  20. "Compilers": {
  21. "c": {
  22. "name": "gcc",
  23. "linker": r"ld.bfd",
  24. "version": "10.3.0",
  25. "commands": r"C:\Strawberry\c\bin\ccache.EXE, cc",
  26. "args": r"",
  27. "linker args": r"",
  28. },
  29. "cython": {
  30. "name": r"cython",
  31. "linker": r"cython",
  32. "version": r"3.2.4",
  33. "commands": r"cython",
  34. "args": r"",
  35. "linker args": r"",
  36. },
  37. "c++": {
  38. "name": "gcc",
  39. "linker": r"ld.bfd",
  40. "version": "10.3.0",
  41. "commands": r"C:\Strawberry\c\bin\ccache.EXE, c++",
  42. "args": r"",
  43. "linker args": r"",
  44. },
  45. "fortran": {
  46. "name": "gcc",
  47. "linker": r"ld.bfd",
  48. "version": "10.3.0",
  49. "commands": r"gfortran",
  50. "args": r"",
  51. "linker args": r"",
  52. },
  53. "pythran": {
  54. "version": r"0.18.1",
  55. "include directory": r"C:\Users\runneradmin\AppData\Local\Temp\build-env-jfo4tcpw\Lib\site-packages/pythran"
  56. },
  57. },
  58. "Machine Information": {
  59. "host": {
  60. "cpu": r"x86_64",
  61. "family": r"x86_64",
  62. "endian": r"little",
  63. "system": r"windows",
  64. },
  65. "build": {
  66. "cpu": r"x86_64",
  67. "family": r"x86_64",
  68. "endian": r"little",
  69. "system": r"windows",
  70. },
  71. "cross-compiled": bool("False".lower().replace('false', '')),
  72. },
  73. "Build Dependencies": {
  74. "blas": {
  75. "name": "scipy-openblas",
  76. "found": bool("True".lower().replace('false', '')),
  77. "version": "0.3.30",
  78. "detection method": "pkgconfig",
  79. "include directory": r"C:/Users/runneradmin/AppData/Local/Temp/cibw-run-xk1ry62f/cp312-win_amd64/build/venv/Lib/site-packages/scipy_openblas32/include",
  80. "lib directory": r"C:/Users/runneradmin/AppData/Local/Temp/cibw-run-xk1ry62f/cp312-win_amd64/build/venv/Lib/site-packages/scipy_openblas32/lib",
  81. "openblas configuration": r"OpenBLAS 0.3.30 DYNAMIC_ARCH NO_AFFINITY Haswell MAX_THREADS=24",
  82. "pc file directory": r"D:/a/scipy/scipy",
  83. "has ilp64": bool(r"False".lower().replace('false', '')),
  84. },
  85. "lapack": {
  86. "name": "scipy-openblas",
  87. "found": bool("True".lower().replace('false', '')),
  88. "version": "0.3.30",
  89. "detection method": "pkgconfig",
  90. "include directory": r"C:/Users/runneradmin/AppData/Local/Temp/cibw-run-xk1ry62f/cp312-win_amd64/build/venv/Lib/site-packages/scipy_openblas32/include",
  91. "lib directory": r"C:/Users/runneradmin/AppData/Local/Temp/cibw-run-xk1ry62f/cp312-win_amd64/build/venv/Lib/site-packages/scipy_openblas32/lib",
  92. "openblas configuration": r"OpenBLAS 0.3.30 DYNAMIC_ARCH NO_AFFINITY Haswell MAX_THREADS=24",
  93. "pc file directory": r"D:/a/scipy/scipy",
  94. "has ilp64": bool(r"False".lower().replace('false', '')),
  95. },
  96. "pybind11": {
  97. "name": "pybind11",
  98. "version": "3.0.2",
  99. "detection method": "config-tool",
  100. "include directory": r"unknown",
  101. },
  102. },
  103. "Python Information": {
  104. "path": r"C:\Users\runneradmin\AppData\Local\Temp\build-env-jfo4tcpw\Scripts\python.exe",
  105. "version": "3.12",
  106. },
  107. }
  108. )
  109. def _check_pyyaml():
  110. import yaml
  111. return yaml
  112. def show(mode=DisplayModes.stdout.value):
  113. """
  114. Show libraries and system information on which SciPy was built
  115. and is being used
  116. Parameters
  117. ----------
  118. mode : {`'stdout'`, `'dicts'`}, optional.
  119. Indicates how to display the config information.
  120. `'stdout'` prints to console, `'dicts'` returns a dictionary
  121. of the configuration.
  122. Returns
  123. -------
  124. out : {`dict`, `None`}
  125. If mode is `'dicts'`, a dict is returned, else None
  126. Examples
  127. --------
  128. >>> import scipy
  129. >>> scipy.show_config()
  130. ... # formatted output is printed to the console
  131. >>> config_dict = scipy.show_config(mode='dicts')
  132. >>> list(config_dict.keys())
  133. ['Compilers', 'Machine Information', 'Build Dependencies', 'Python Information']
  134. Notes
  135. -----
  136. 1. The `'stdout'` mode will give more readable
  137. output if ``pyyaml`` is installed
  138. """
  139. if mode == DisplayModes.stdout.value:
  140. try: # Non-standard library, check import
  141. yaml = _check_pyyaml()
  142. print(yaml.dump(CONFIG))
  143. except ModuleNotFoundError:
  144. import warnings
  145. import json
  146. warnings.warn("Install `pyyaml` for better output", stacklevel=1)
  147. print(json.dumps(CONFIG, indent=2))
  148. elif mode == DisplayModes.dicts.value:
  149. return CONFIG
  150. else:
  151. raise AttributeError(
  152. f"Invalid `mode`, use one of: {', '.join([e.value for e in DisplayModes])}"
  153. )