Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
_configtool.py40 linesDownload Raw Back to numpy
1import argparse
2import sys
3from pathlib import Path
4
5from .lib._utils_impl import get_include
6from .version import __version__
7
8
9def main() -> None:
10    parser = argparse.ArgumentParser()
11    parser.add_argument(
12        "--version",
13        action="version",
14        version=__version__,
15        help="Print the version and exit.",
16    )
17    parser.add_argument(
18        "--cflags",
19        action="store_true",
20        help="Compile flag needed when using the NumPy headers.",
21    )
22    parser.add_argument(
23        "--pkgconfigdir",
24        action="store_true",
25        help=("Print the pkgconfig directory in which `numpy.pc` is stored "
26              "(useful for setting $PKG_CONFIG_PATH)."),
27    )
28    args = parser.parse_args()
29    if not sys.argv[1:]:
30        parser.print_help()
31    if args.cflags:
32        print("-I" + get_include())
33    if args.pkgconfigdir:
34        _path = Path(get_include()) / '..' / 'lib' / 'pkgconfig'
35        print(_path.resolve())
36
37
38if __name__ == "__main__":
39    main()
40 
codekingpro/portable-devtools · Team Ai