generated from ApeWorX/project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: lazify imports for
ape --help
(#155)
- Loading branch information
Showing
10 changed files
with
89 additions
and
44 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,14 +1,45 @@ | ||
from ape import plugins | ||
from typing import Any | ||
|
||
from ._utils import Extension | ||
from .compiler import SolidityCompiler, SolidityConfig | ||
from ape import plugins | ||
|
||
|
||
@plugins.register(plugins.Config) | ||
def config_class(): | ||
from .compiler import SolidityConfig | ||
|
||
return SolidityConfig | ||
|
||
|
||
@plugins.register(plugins.CompilerPlugin) | ||
def register_compiler(): | ||
from ._utils import Extension | ||
from .compiler import SolidityCompiler | ||
|
||
return (Extension.SOL.value,), SolidityCompiler | ||
|
||
|
||
def __getattr__(name: str) -> Any: | ||
if name == "Extension": | ||
from ._utils import Extension | ||
|
||
return Extension | ||
|
||
elif name == "SolidityCompiler": | ||
from .compiler import SolidityCompiler | ||
|
||
return SolidityCompiler | ||
|
||
elif name == "SolidityConfig": | ||
from .compiler import SolidityConfig | ||
|
||
return SolidityConfig | ||
|
||
else: | ||
raise AttributeError(name) | ||
|
||
|
||
__all__ = [ | ||
"Extension", | ||
"SolidityCompiler", | ||
"SolidityConfig", | ||
] |
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
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,7 +1,9 @@ | ||
[flake8] | ||
max-line-length = 100 | ||
ignore = E704,W503,PYD002,TC003,TC006 | ||
exclude = | ||
venv* | ||
docs | ||
build | ||
tests/node_modules | ||
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