Skip to content

Commit

Permalink
fix: adds attributes back to __init__ (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwise-constructs authored Nov 20, 2024
1 parent 62d3487 commit a5be01e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
additional_dependencies: [types-setuptools, pydantic]

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.18
rev: 0.7.19
hooks:
- id: mdformat
additional_dependencies: [mdformat-gfm, mdformat-frontmatter]
Expand Down
27 changes: 27 additions & 0 deletions ape_optimism/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,30 @@ def providers():
yield "optimism", network_name, Node

yield "optimism", LOCAL_NETWORK_NAME, LocalProvider


def __getattr__(name: str):
if name == "NETWORKS":
from .ecosystem import NETWORKS

return NETWORKS

elif name == "Optimism":
from .ecosystem import Optimism

return Optimism

elif name == "OptimismConfig":
from .ecosystem import OptimismConfig

return OptimismConfig

else:
raise AttributeError(name)


__all__ = [
"NETWORKS",
"Optimism",
"OptimismConfig",
]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"flake8-breakpoint>=1.1.0,<2", # Detect breakpoints left in code
"flake8-print>=5.0.0,<6", # Detect print statements left in code
"isort>=5.13.2,<6", # Import sorting linter
"mdformat>=0.7.18", # Auto-formatter for markdown
"mdformat>=0.7.19", # Auto-formatter for markdown
"mdformat-gfm>=0.3.5", # Needed for formatting GitHub-flavored markdown
"mdformat-frontmatter>=0.4.1", # Needed for frontmatters-style headers in issue templates
"mdformat-pyproject>=0.0.1", # Allows configuring in pyproject.toml
Expand Down

0 comments on commit a5be01e

Please sign in to comment.