Skip to content

Commit 14a7b3c

Browse files
committed
Explicitly re-export names from top-level package using __all__
This avoids the re-exports from being flagged as errors when a project that uses Invoke is checked using `mypy --no-implicit-reexport`. It also obsoletes all flake8 suppressions in `__init__.py`.
1 parent 506bf4e commit 14a7b3c

File tree

1 file changed

+58
-13
lines changed

1 file changed

+58
-13
lines changed

invoke/__init__.py

Lines changed: 58 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,55 @@
1+
__all__ = (
2+
"AmbiguousEnvVar",
3+
"Argument",
4+
"AuthFailure",
5+
"Call",
6+
"Collection",
7+
"CollectionNotFound",
8+
"CommandTimedOut",
9+
"Config",
10+
"Context",
11+
"Executor",
12+
"Exit",
13+
"FailingResponder",
14+
"Failure",
15+
"FilesystemLoader",
16+
"Local",
17+
"MockContext",
18+
"ParseError",
19+
"ParseResult",
20+
"Parser",
21+
"ParserContext",
22+
"PlatformError",
23+
"Program",
24+
"Promise",
25+
"Responder",
26+
"ResponseNotAccepted",
27+
"Result",
28+
"Runner",
29+
"StreamWatcher",
30+
"SubprocessPipeError",
31+
"Task",
32+
"ThreadException",
33+
"UncastableEnvVar",
34+
"UnexpectedExit",
35+
"UnknownFileType",
36+
"UnpicklableConfigMember",
37+
"WatcherError",
38+
"__version__",
39+
"__version_info__",
40+
"call",
41+
"pty_size",
42+
"task",
43+
)
44+
45+
146
from typing import Any, Optional
247

3-
from ._version import __version_info__, __version__ # noqa
4-
from .collection import Collection # noqa
5-
from .config import Config # noqa
6-
from .context import Context, MockContext # noqa
7-
from .exceptions import ( # noqa
48+
from ._version import __version_info__, __version__
49+
from .collection import Collection
50+
from .config import Config
51+
from .context import Context, MockContext
52+
from .exceptions import (
853
AmbiguousEnvVar,
954
AuthFailure,
1055
CollectionNotFound,
@@ -21,14 +66,14 @@
2166
WatcherError,
2267
CommandTimedOut,
2368
)
24-
from .executor import Executor # noqa
25-
from .loader import FilesystemLoader # noqa
26-
from .parser import Argument, Parser, ParserContext, ParseResult # noqa
27-
from .program import Program # noqa
28-
from .runners import Runner, Local, Failure, Result, Promise # noqa
29-
from .tasks import task, call, Call, Task # noqa
30-
from .terminals import pty_size # noqa
31-
from .watchers import FailingResponder, Responder, StreamWatcher # noqa
69+
from .executor import Executor
70+
from .loader import FilesystemLoader
71+
from .parser import Argument, Parser, ParserContext, ParseResult
72+
from .program import Program
73+
from .runners import Runner, Local, Failure, Result, Promise
74+
from .tasks import task, call, Call, Task
75+
from .terminals import pty_size
76+
from .watchers import FailingResponder, Responder, StreamWatcher
3277

3378

3479
def run(command: str, **kwargs: Any) -> Optional[Result]:

0 commit comments

Comments
 (0)