Skip to content

Commit 90ef249

Browse files
authored
Fix warnings about the Config class being deprecated in Pydantic 3 (#67)
Also upgrades a couple of dev dependencies needed to get the build running.
1 parent 0c1d784 commit 90ef249

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ source env/bin/activate
100100
python3 -m pip install -r requirements-dev.txt
101101

102102
## Install locally
103-
pip install -e .
103+
pip install -e .[adlfs,azure,dev]
104104

105105
## Format code
106106
./scripts/format

planetary_computer/sas.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ class SASBase(BaseModel):
4343
expiry: datetime = Field(alias="msft:expiry")
4444
"""RFC339 datetime format of the time this token will expire"""
4545

46-
class Config:
47-
if _PYDANTIC_2_0:
48-
populate_by_name = True
49-
else:
46+
if _PYDANTIC_2_0:
47+
model_config = pydantic.ConfigDict(populate_by_name=True)
48+
else:
49+
50+
class Config:
5051
allow_population_by_field_name = True
5152
json_encoders = {datetime: datetime_to_str}
5253

requirements-dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
black==24.3.0
2-
flake8==4.0.1
2+
flake8==7.2.0
33
ipdb==0.13.9
4-
mypy==0.961
4+
mypy==1.15.0
55
types-requests==2.28.1
66
setuptools==65.5.1
77
pytest

0 commit comments

Comments
 (0)