Skip to content

Commit

Permalink
chore: pydantic updates
Browse files Browse the repository at this point in the history
  • Loading branch information
NotPeopling2day committed Nov 21, 2023
1 parent db4326f commit 87ee505
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"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
"pydantic<2.0", # Needed for successful type check. TODO: Remove after full v2 support.
],
"doc": [
"myst-parser>=1.0.0,<2", # Parse markdown docs
Expand Down
7 changes: 6 additions & 1 deletion src/ape/types/address.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
from importlib import import_module
from typing import Annotated, Any, Optional, Union
from typing import Any, Optional, Union

from eth_pydantic_types import Address as _Address
from eth_pydantic_types import HashBytes20, HashStr20
from eth_typing import ChecksumAddress
from pydantic_core.core_schema import ValidationInfo

try:
from typing import Annotated # type: ignore
except ImportError:
from typing_extensions import Annotated # type: ignore

RawAddress = Union[str, int, HashStr20, HashBytes20]
"""
A raw data-type representation of an address.
Expand Down
2 changes: 2 additions & 0 deletions src/ape/utils/basemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ class ExtraModelAttributes(EthpmTypesBaseModel):
A class for defining extra model attributes.
"""

model_config = ConfigDict(arbitrary_types_allowed=True)

name: str
"""
The name of the attributes. This is important
Expand Down

0 comments on commit 87ee505

Please sign in to comment.