diff --git a/ppdet/core/config/schema.py b/ppdet/core/config/schema.py index efba5be1dfd93243ff7a071f0f30accfa513e18f..4465c730623919c8c0fa65bdb4d8e0d6acbe63e5 100644 --- a/ppdet/core/config/schema.py +++ b/ppdet/core/config/schema.py @@ -23,32 +23,13 @@ import re try: from docstring_parser import parse as doc_parse except Exception: - def doc_parse(*args): - if not doc_parse.__warning_sent__: - from ppdet.utils.cli import ColorTTY - color_tty = ColorTTY() - message = "docstring_parser is not installed, " \ - + "argument description is not available" - print(color_tty.yellow(message)) - doc_parse.__warning_sent__ = True - - doc_parse.__warning_sent__ = False - + pass try: from typeguard import check_type except Exception: - def check_type(*args): - if not check_type.__warning_sent__: - from ppdet.utils.cli import ColorTTY - color_tty = ColorTTY() - message = "typeguard is not installed," \ - + "type checking is not available" - print(color_tty.yellow(message)) - check_type.__warning_sent__ = True - - check_type.__warning_sent__ = False + pass __all__ = ['SchemaValue', 'SchemaDict', 'SharedConfig', 'extract_schema'] diff --git a/tools/configure.py b/tools/configure.py index 560d161513ae8f0115d8d3d5f97f6a0695642015..098f48f8448d0b544cd32294a6152a3dd5288556 100644 --- a/tools/configure.py +++ b/tools/configure.py @@ -24,6 +24,20 @@ from ppdet.utils.cli import ColorTTY, print_total_cfg color_tty = ColorTTY() +try: + from docstring_parser import parse as doc_parse +except Exception: + message = "docstring_parser is not installed, " \ + + "argument description is not available" + print(color_tty.yellow(message)) + +try: + from typeguard import check_type +except Exception: + message = "typeguard is not installed," \ + + "type checking is not available" + print(color_tty.yellow(message)) + MISC_CONFIG = { "architecture": "", "max_iters": "",