From aaba87db5016d0d6f7137a87aeb2ef15856ab4cf Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Mon, 11 Dec 2023 21:47:54 -0600 Subject: [PATCH 1/3] chore: lint --- .pre-commit-config.yaml | 6 +++--- setup.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2001bc4..7c4296e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-yaml @@ -10,7 +10,7 @@ repos: - id: isort - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 23.11.0 hooks: - id: black name: black @@ -21,7 +21,7 @@ repos: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.5.1 + rev: v1.7.1 hooks: - id: mypy additional_dependencies: [types-setuptools, types-requests] diff --git a/setup.py b/setup.py index 5faacd6..00f2365 100644 --- a/setup.py +++ b/setup.py @@ -13,8 +13,8 @@ "hypothesis-jsonschema==0.19.0", # Fuzzes based on a json schema ], "lint": [ - "black>=23.9.1,<24", # auto-formatter and linter - "mypy>=1.5.1,<2", # Static type analyzer + "black>=23.11.0,<24", # auto-formatter and linter + "mypy>=1.7.1,<2", # Static type analyzer "types-requests", # Needed due to mypy typeshed "types-setuptools", # Needed due to mypy typeshed "flake8>=6.1.0,<7", # Style linter From 27f357f991af53ace08fee81f5ba270c964c5e07 Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Mon, 11 Dec 2023 21:54:42 -0600 Subject: [PATCH 2/3] chore: lint --- setup.py | 4 ++-- tokenlists/typing.py | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 00f2365..45cac87 100644 --- a/setup.py +++ b/setup.py @@ -68,8 +68,8 @@ python_requires=">=3.8,<4", install_requires=[ "importlib-metadata ; python_version<'3.8'", - "click>=8.1.3,<9", - "pydantic>=2.3.0,<3", + "click>=8.1.7,<9", + "pydantic>=2.5.2,<3", "pyyaml>=6.0,<7", "requests>=2.28.1,<3", ], diff --git a/tokenlists/typing.py b/tokenlists/typing.py index bc9afee..3565758 100644 --- a/tokenlists/typing.py +++ b/tokenlists/typing.py @@ -3,7 +3,7 @@ from pydantic import AnyUrl from pydantic import BaseModel as _BaseModel -from pydantic import PastDatetime, field_validator +from pydantic import ConfigDict, PastDatetime, field_validator ChainId = int TagId = str @@ -20,8 +20,7 @@ def model_dump(self, *args, **kwargs): return super().model_dump(*args, **kwargs) - class Config: - froze = True + model_config = ConfigDict(froze=True) class BridgeInfo(BaseModel): @@ -177,9 +176,7 @@ def __init__(self, *args, **kwargs): f"Missing reference tags in tokenlist: {token_ref_tags - tokenlist_tags}" ) - class Config: - # NOTE: Not frozen as we may need to dynamically modify this - froze = False + model_config = ConfigDict(froze=False) @field_validator("logoURI") def validate_uri(cls, v: Optional[str]) -> Optional[str]: From 3819d7c2e4d1ccde429674f31bf7fe0878277e48 Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Mon, 11 Dec 2023 21:56:11 -0600 Subject: [PATCH 3/3] fix: missed --- tokenlists/typing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tokenlists/typing.py b/tokenlists/typing.py index 3565758..57eb828 100644 --- a/tokenlists/typing.py +++ b/tokenlists/typing.py @@ -20,7 +20,7 @@ def model_dump(self, *args, **kwargs): return super().model_dump(*args, **kwargs) - model_config = ConfigDict(froze=True) + model_config = ConfigDict(frozen=True) class BridgeInfo(BaseModel): @@ -176,7 +176,7 @@ def __init__(self, *args, **kwargs): f"Missing reference tags in tokenlist: {token_ref_tags - tokenlist_tags}" ) - model_config = ConfigDict(froze=False) + model_config = ConfigDict(frozen=False) @field_validator("logoURI") def validate_uri(cls, v: Optional[str]) -> Optional[str]: