Skip to content

Commit

Permalink
Migrate to pydantic >= 2.0 (#613)
Browse files Browse the repository at this point in the history
* Revert to v1 api

* Use 2.0.0 as the minimum version
  • Loading branch information
Vectorrent authored Jul 13, 2024
1 parent 14ff472 commit 128ee90
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/albert/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Dict, List, Tuple

from pydantic import BaseModel, StrictFloat, confloat, conint
from pydantic.v1 import BaseModel, StrictFloat, confloat, conint

from hivemind.dht.crypto import RSASignatureValidator
from hivemind.dht.schema import BytesWithPublicKey, SchemaValidator
Expand Down
2 changes: 1 addition & 1 deletion hivemind/dht/schema.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re
from typing import Any, Dict, Optional, Type

import pydantic
import pydantic.v1 as pydantic

from hivemind.dht.crypto import RSASignatureValidator
from hivemind.dht.protocol import DHTProtocol
Expand Down
2 changes: 1 addition & 1 deletion hivemind/optim/progress_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Dict, Optional

import numpy as np
from pydantic import BaseModel, StrictBool, StrictFloat, confloat, conint
from pydantic.v1 import BaseModel, StrictBool, StrictFloat, confloat, conint

from hivemind.dht import DHT
from hivemind.dht.schema import BytesWithPublicKey, RSASignatureValidator, SchemaValidator
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ configargparse>=1.2.3
py-multihash>=0.2.3
multiaddr @ git+https://github.com/multiformats/py-multiaddr.git@e01dbd38f2c0464c0f78b556691d655265018cce
cryptography>=3.4.6
pydantic>=1.8.1,<2.0
pydantic>=2.0.0
packaging>=20.9
2 changes: 1 addition & 1 deletion tests/test_dht_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Dict

import pytest
from pydantic import BaseModel, StrictInt, conint
from pydantic.v1 import BaseModel, StrictInt, conint

import hivemind
from hivemind.dht.node import DHTNode
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dht_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Dict

import pytest
from pydantic import BaseModel, StrictInt
from pydantic.v1 import BaseModel, StrictInt

import hivemind
from hivemind.dht.crypto import RSASignatureValidator
Expand Down

0 comments on commit 128ee90

Please sign in to comment.