Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to pydantic >= 2.0 #613

Merged
merged 38 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
24aabf8
first pass at migration to pydantic > 2.0
Vectorrent Jun 4, 2024
62bd489
fix linting and tests
Vectorrent Jun 5, 2024
8801689
migrate deprecated torch.cuda.amp imports to torch.amp
Vectorrent Jun 7, 2024
78cfaed
add if/else check to handle differences between torch versions
Vectorrent Jun 7, 2024
51542ed
fix linting
Vectorrent Jun 7, 2024
b254425
update wandb package, fixing docker build
Vectorrent Jun 7, 2024
945176a
fix validators, and pass tests locally in Docker
Vectorrent Jun 7, 2024
6ca96f4
fix deprecated pkg_resources import
Vectorrent Jun 7, 2024
5cfe829
fix 2 tests
Vectorrent Jun 7, 2024
917eda7
fix pkg_resources again
Vectorrent Jun 7, 2024
c968b58
pain
Vectorrent Jun 7, 2024
c1dc7e2
partial fix of p2pd
Vectorrent Jun 7, 2024
42aa111
revert to old failing method for now
Vectorrent Jun 7, 2024
6f43d74
oops
Vectorrent Jun 7, 2024
46efb9b
fix pydantic deprecations, p2pd path handling
Vectorrent Jun 9, 2024
3045008
update black version
Vectorrent Jun 9, 2024
d4a4d26
revert black
Vectorrent Jun 9, 2024
055d1ce
make path handling work across all Python versions
Vectorrent Jun 9, 2024
df9f4e9
revert path handling
Vectorrent Jun 9, 2024
a55e527
Merge branch 'master' into upgrade-pydantic
justheuristic Jun 9, 2024
3d3e444
Merge branch 'master' into upgrade-pydantic
justheuristic Jun 9, 2024
bc5a52f
Merge commit '3d3e444618ca1b757061c607fe7a399f750ca0e3' into upgrade-…
Vectorrent Jun 10, 2024
32a1c68
revert to v1 api
Vectorrent Jun 10, 2024
cdb3de8
test 3.12 as well
Vectorrent Jun 10, 2024
3e22780
this error message has changed slightly
Vectorrent Jun 11, 2024
eba80fa
update test with unexpected error message
Vectorrent Jun 11, 2024
a8ae34b
rerun tests
Vectorrent Jun 11, 2024
84e225d
fix another edge case
Vectorrent Jun 11, 2024
5a8c31f
address comments
Vectorrent Jun 11, 2024
47d932c
revert changes
Vectorrent Jun 12, 2024
da4d798
restore broken amp
Vectorrent Jun 12, 2024
3cd9d38
revert to 2.0.0
Vectorrent Jun 12, 2024
d3593eb
un-fix other things
Vectorrent Jun 13, 2024
19004cc
nit
Vectorrent Jun 13, 2024
b2d95c8
nit
Vectorrent Jun 13, 2024
ad080ed
Restore Max's optimizer commit
Vectorrent Jun 13, 2024
6df0176
Merge branch 'master' into upgrade-pydantic
mryab Jul 13, 2024
13bfad3
restore a line break
Vectorrent Jul 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading