Skip to content

Commit 5a25251

Browse files
committed
refactor(CLI): move types out of type checking pass so that click works
1 parent 9865efa commit 5a25251

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

ape_safe/_cli/modules.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
from typing import TYPE_CHECKING
2-
31
import click
2+
from ape.api import AccountAPI # noqa: TC002
43
from ape.cli import ConnectedProviderCommand, account_option, network_option
54
from ape.types import AddressType
65

76
from ape_safe._cli.click_ext import safe_argument
8-
9-
if TYPE_CHECKING:
10-
from ape.api import AccountAPI
11-
12-
from ape_safe.accounts import SafeAccount
7+
from ape_safe.accounts import SafeAccount # noqa: TC001
138

149

1510
@click.group()
@@ -22,7 +17,7 @@ def modules():
2217
@modules.command("list", cls=ConnectedProviderCommand)
2318
@network_option()
2419
@safe_argument
25-
def _list(safe: "SafeAccount"):
20+
def _list(safe: SafeAccount):
2621
"""List all modules enabled for SAFE"""
2722
for module in safe.modules:
2823
click.echo(repr(module))
@@ -31,7 +26,7 @@ def _list(safe: "SafeAccount"):
3126
@modules.command(cls=ConnectedProviderCommand)
3227
@network_option()
3328
@safe_argument
34-
def guard(safe: "SafeAccount"):
29+
def guard(safe: SafeAccount):
3530
"""Show module guard (if enabled) for SAFE"""
3631
if guard := safe.modules.guard:
3732
click.echo(f"Guard: {guard}")
@@ -46,7 +41,7 @@ def guard(safe: "SafeAccount"):
4641
@safe_argument
4742
@click.option("--propose", is_flag=True, default=False)
4843
@click.argument("module", type=AddressType)
49-
def enable(safe: "SafeAccount", account: "AccountAPI", module: AddressType, propose: bool):
44+
def enable(safe: SafeAccount, account: AccountAPI, module: AddressType, propose: bool):
5045
"""
5146
Enable MODULE for SAFE
5247
@@ -61,7 +56,7 @@ def enable(safe: "SafeAccount", account: "AccountAPI", module: AddressType, prop
6156
@safe_argument
6257
@click.option("--propose", is_flag=True, default=False)
6358
@click.argument("module", type=AddressType)
64-
def disable(safe: "SafeAccount", account: "AccountAPI", module: AddressType, propose: bool):
59+
def disable(safe: SafeAccount, account: AccountAPI, module: AddressType, propose: bool):
6560
"""
6661
Disable MODULE for SAFE
6762

0 commit comments

Comments
 (0)