Skip to content

Commit f556715

Browse files
authored
fix: migrate pydantic config (#38)
1 parent f041671 commit f556715

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
3+
rev: v4.5.0
44
hooks:
55
- id: check-yaml
66

@@ -10,7 +10,7 @@ repos:
1010
- id: isort
1111

1212
- repo: https://github.com/psf/black
13-
rev: 23.9.1
13+
rev: 23.11.0
1414
hooks:
1515
- id: black
1616
name: black
@@ -21,7 +21,7 @@ repos:
2121
- id: flake8
2222

2323
- repo: https://github.com/pre-commit/mirrors-mypy
24-
rev: v1.5.1
24+
rev: v1.7.1
2525
hooks:
2626
- id: mypy
2727
additional_dependencies: [types-setuptools, types-requests]

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"hypothesis-jsonschema==0.19.0", # Fuzzes based on a json schema
1414
],
1515
"lint": [
16-
"black>=23.9.1,<24", # auto-formatter and linter
17-
"mypy>=1.5.1,<2", # Static type analyzer
16+
"black>=23.11.0,<24", # auto-formatter and linter
17+
"mypy>=1.7.1,<2", # Static type analyzer
1818
"types-requests", # Needed due to mypy typeshed
1919
"types-setuptools", # Needed due to mypy typeshed
2020
"flake8>=6.1.0,<7", # Style linter
@@ -68,8 +68,8 @@
6868
python_requires=">=3.8,<4",
6969
install_requires=[
7070
"importlib-metadata ; python_version<'3.8'",
71-
"click>=8.1.3,<9",
72-
"pydantic>=2.3.0,<3",
71+
"click>=8.1.7,<9",
72+
"pydantic>=2.5.2,<3",
7373
"pyyaml>=6.0,<7",
7474
"requests>=2.28.1,<3",
7575
],

tokenlists/typing.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from pydantic import AnyUrl
55
from pydantic import BaseModel as _BaseModel
6-
from pydantic import PastDatetime, field_validator
6+
from pydantic import ConfigDict, PastDatetime, field_validator
77

88
ChainId = int
99
TagId = str
@@ -20,8 +20,7 @@ def model_dump(self, *args, **kwargs):
2020

2121
return super().model_dump(*args, **kwargs)
2222

23-
class Config:
24-
froze = True
23+
model_config = ConfigDict(frozen=True)
2524

2625

2726
class BridgeInfo(BaseModel):
@@ -177,9 +176,7 @@ def __init__(self, *args, **kwargs):
177176
f"Missing reference tags in tokenlist: {token_ref_tags - tokenlist_tags}"
178177
)
179178

180-
class Config:
181-
# NOTE: Not frozen as we may need to dynamically modify this
182-
froze = False
179+
model_config = ConfigDict(frozen=False)
183180

184181
@field_validator("logoURI")
185182
def validate_uri(cls, v: Optional[str]) -> Optional[str]:

0 commit comments

Comments
 (0)