File size: 2,377 Bytes
eb00867 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
from enum import Enum
from types import ModuleType
from typing import Final, Literal as L, TypedDict, overload, type_check_only
from typing_extensions import NotRequired
_CompilerConfigDictValue = TypedDict(
"_CompilerConfigDictValue",
{
"name": str,
"linker": str,
"version": str,
"commands": str,
"args": str,
"linker args": str,
},
)
_CompilerConfigDict = TypedDict(
"_CompilerConfigDict",
{
"c": _CompilerConfigDictValue,
"cython": _CompilerConfigDictValue,
"c++": _CompilerConfigDictValue,
},
)
_MachineInformationDict = TypedDict(
"_MachineInformationDict",
{
"host":_MachineInformationDictValue,
"build": _MachineInformationDictValue,
"cross-compiled": NotRequired[L[True]],
},
)
@type_check_only
class _MachineInformationDictValue(TypedDict):
cpu: str
family: str
endian: L["little", "big"]
system: str
_BuildDependenciesDictValue = TypedDict(
"_BuildDependenciesDictValue",
{
"name": str,
"found": NotRequired[L[True]],
"version": str,
"include directory": str,
"lib directory": str,
"openblas configuration": str,
"pc file directory": str,
},
)
class _BuildDependenciesDict(TypedDict):
blas: _BuildDependenciesDictValue
lapack: _BuildDependenciesDictValue
class _PythonInformationDict(TypedDict):
path: str
version: str
_SIMDExtensionsDict = TypedDict(
"_SIMDExtensionsDict",
{
"baseline": list[str],
"found": list[str],
"not found": list[str],
},
)
_ConfigDict = TypedDict(
"_ConfigDict",
{
"Compilers": _CompilerConfigDict,
"Machine Information": _MachineInformationDict,
"Build Dependencies": _BuildDependenciesDict,
"Python Information": _PythonInformationDict,
"SIMD Extensions": _SIMDExtensionsDict,
},
)
###
__all__ = ["show_config"]
CONFIG: Final[_ConfigDict] = ...
class DisplayModes(Enum):
stdout = "stdout"
dicts = "dicts"
def _check_pyyaml() -> ModuleType: ...
@overload
def show(mode: L["stdout"] = "stdout") -> None: ...
@overload
def show(mode: L["dicts"]) -> _ConfigDict: ...
@overload
def show_config(mode: L["stdout"] = "stdout") -> None: ...
@overload
def show_config(mode: L["dicts"]) -> _ConfigDict: ...
|