diff --git a/ape_arbitrum/__init__.py b/ape_arbitrum/__init__.py index 3d6915a..46b02e9 100644 --- a/ape_arbitrum/__init__.py +++ b/ape_arbitrum/__init__.py @@ -1,23 +1,31 @@ from ape import plugins -from ape.api.networks import LOCAL_NETWORK_NAME, ForkedNetworkAPI, NetworkAPI, create_network_type -from ape_node import Node -from ape_test import LocalProvider - -from .ecosystem import NETWORKS, Arbitrum, ArbitrumConfig @plugins.register(plugins.Config) def config_class(): + from .ecosystem import ArbitrumConfig + return ArbitrumConfig @plugins.register(plugins.EcosystemPlugin) def ecosystems(): + from .ecosystem import Arbitrum + yield Arbitrum @plugins.register(plugins.NetworkPlugin) def networks(): + from ape.api.networks import ( + LOCAL_NETWORK_NAME, + ForkedNetworkAPI, + NetworkAPI, + create_network_type, + ) + + from .ecosystem import NETWORKS + for network_name, network_params in NETWORKS.items(): yield "arbitrum", network_name, create_network_type(*network_params) yield "arbitrum", f"{network_name}-fork", ForkedNetworkAPI @@ -28,7 +36,19 @@ def networks(): @plugins.register(plugins.ProviderPlugin) def providers(): + from ape.api.networks import LOCAL_NETWORK_NAME + from ape_node import Node + from ape_test import LocalProvider + + from .ecosystem import NETWORKS + for network_name in NETWORKS: yield "arbitrum", network_name, Node yield "arbitrum", LOCAL_NETWORK_NAME, LocalProvider + + +def __getattr__(name: str): + import ape_arbitrum.ecosystem as module + + return getattr(module, name) diff --git a/setup.cfg b/setup.cfg index 22eb548..ca146b1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,9 +1,10 @@ [flake8] max-line-length = 100 -ignore = E704,W503,PYD002 +ignore = E704,W503,PYD002,TC003,TC006 exclude = .venv* venv* .eggs docs build +type-checking-pydantic-enabled = True