generated from ApeWorX/project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: make CLI
--help
command and root module load faster (#45)
- Loading branch information
Showing
9 changed files
with
120 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,33 @@ | ||
from ape import plugins | ||
from importlib import import_module | ||
from typing import Any | ||
|
||
from .accounts import AccountContainer, TrezorAccount, TrezorConfig | ||
from ape import plugins | ||
|
||
|
||
@plugins.register(plugins.Config) | ||
def config_class(): | ||
from .accounts import TrezorConfig | ||
|
||
return TrezorConfig | ||
|
||
|
||
@plugins.register(plugins.AccountPlugin) | ||
def account_types(): | ||
from .accounts import AccountContainer, TrezorAccount | ||
|
||
return AccountContainer, TrezorAccount | ||
|
||
|
||
def __getattr__(name: str) -> Any: | ||
if name in ("AccountContainer", "TrezorAccount", "TrezorConfig"): | ||
return getattr(import_module("ape_trezor.accounts"), name) | ||
|
||
else: | ||
raise AttributeError(name) | ||
|
||
|
||
__all__ = [ | ||
"AccountContainer", | ||
"TrezorAccount", | ||
"TrezorConfig", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
[flake8] | ||
max-line-length = 100 | ||
ignore = E704,W503,PYD002,TC003,TC006 | ||
exclude = | ||
venv* | ||
docs | ||
build | ||
type-checking-pydantic-enabled = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.