codekingpro/portable-devtools
114k
1import argparse
2import pprint
3from collections.abc import Hashable, Iterable, Mapping, MutableMapping, Sequence
4from types import ModuleType
5from typing import Any, Final, NotRequired, TypedDict, type_check_only
6from typing_extensions import TypeVar, override
7
8from .__version__ import version
9from .auxfuncs import _Bool, outmess as outmess
10
11###
12
13_KT = TypeVar("_KT", bound=Hashable)
14_VT = TypeVar("_VT")
15
16@type_check_only
17class _F2PyDict(TypedDict):
18 csrc: list[str]
19 h: list[str]
20 fsrc: NotRequired[list[str]]
21 ltx: NotRequired[list[str]]
22
23@type_check_only
24class _PreparseResult(TypedDict):
25 dependencies: list[str]
26 backend: str
27 modulename: str
28
29###
30
31MESON_ONLY_VER: Final[bool]
32f2py_version: Final = version
33numpy_version: Final = version
34__usage__: Final[str]
35
36show = pprint.pprint
37
38class CombineIncludePaths(argparse.Action):
39 @override
40 def __call__(
41 self,
42 /,
43 parser: argparse.ArgumentParser,
44 namespace: argparse.Namespace,
45 values: str | Sequence[str] | None,
46 option_string: str | None = None,
47 ) -> None: ...
48
49#
50def run_main(comline_list: Iterable[str]) -> dict[str, _F2PyDict]: ...
51def run_compile() -> None: ...
52def main() -> None: ...
53
54#
55def scaninputline(inputline: Iterable[str]) -> tuple[list[str], dict[str, _Bool]]: ...
56def callcrackfortran(files: list[str], options: dict[str, bool]) -> list[dict[str, Any]]: ...
57def buildmodules(lst: Iterable[Mapping[str, object]]) -> dict[str, dict[str, Any]]: ...
58def dict_append(d_out: MutableMapping[_KT, _VT], d_in: Mapping[_KT, _VT]) -> None: ...
59def filter_files(
60 prefix: str,
61 suffix: str,
62 files: Iterable[str],
63 remove_prefix: _Bool | None = None,
64) -> tuple[list[str], list[str]]: ...
65def get_prefix(module: ModuleType) -> str: ...
66def get_newer_options(iline: Iterable[str]) -> tuple[list[str], Any, list[str]]: ...
67
68#
69def f2py_parser() -> argparse.ArgumentParser: ...
70def make_f2py_compile_parser() -> argparse.ArgumentParser: ...
71
72#
73def preparse_sysargv() -> _PreparseResult: ...
74def validate_modulename(pyf_files: Sequence[str], modulename: str = "untitled") -> str: ...
75 