Skip to content

Commit f90db55

Browse files
committed
MyPy strict checking doesn't allow implicit exports. Must explicitly export in __init__.py
1 parent 5165ede commit f90db55

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

cmd2/__init__.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# package is not installed
1616
pass
1717

18+
from typing import List
19+
1820
from .ansi import style, fg, bg
1921
from .argparse_custom import Cmd2ArgumentParser, Cmd2AttributeWrapper, CompletionItem, set_default_argument_parser
2022

@@ -38,3 +40,42 @@
3840
from .parsing import Statement
3941
from .py_bridge import CommandResult
4042
from .utils import categorize, CompletionMode, CustomCompletionSettings, Settable
43+
44+
45+
__all__: List[str] = [
46+
'COMMAND_NAME',
47+
'DEFAULT_ARGUMENT_PARSER',
48+
'DEFAULT_SHORTCUTS',
49+
# ANSI Style exports
50+
'bg',
51+
'fg',
52+
'style',
53+
# Argparse Exports
54+
'Cmd2ArgumentParser',
55+
'Cmd2AttributeWrapper',
56+
'CompletionItem',
57+
'set_default_argument_parser',
58+
# Cmd2
59+
'Cmd',
60+
'CommandResult',
61+
'CommandSet',
62+
'Statement',
63+
# Decorators
64+
'with_argument_list',
65+
'with_argparser',
66+
'with_category',
67+
'with_default_category',
68+
'as_subcommand_to',
69+
# Exceptions
70+
'Cmd2ArgparseError',
71+
'CommandSetRegistrationError',
72+
'CompletionError',
73+
'SkipPostcommandHooks',
74+
# modules
75+
'plugin',
76+
# Utilities
77+
'categorize',
78+
'CompletionMode',
79+
'CustomCompletionSettings',
80+
'Settable',
81+
]

0 commit comments

Comments
 (0)