Skip to content

Commit 6c19baa

Browse files
committed
fix: upgrade to pydantic 2
Closes #274
1 parent ecfd7c5 commit 6c19baa

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

popmon/config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121

2222
import pandas as pd
2323
from histogrammar.dfinterface.make_histograms import get_time_axes
24-
from pydantic import BaseModel, BaseSettings
24+
from pydantic import BaseModel
25+
from pydantic_settings import BaseSettings
2526
from typing_extensions import Literal
2627

2728
# Global configuration for the joblib parallelization. Could be used to change the number of jobs, and/or change
@@ -32,7 +33,7 @@
3233

3334
class ValidatedSettings(BaseSettings):
3435
class Config:
35-
validate_all = True
36+
validate_default = True
3637
validate_assignment = True
3738

3839

pyproject.toml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ dependencies = [
3131
"plotly>=5.8.0",
3232
"joblib>=0.14.0",
3333
"htmlmin",
34-
"pydantic",
35-
"typing_extensions"
34+
"pydantic>=2",
35+
"pydantic-settings",
36+
"typing_extensions",
37+
"tomli >= 1.1.0 ; python_version < '3.11'"
3638
]
3739
classifiers = [
3840
"Programming Language :: Python :: 3",
@@ -105,6 +107,10 @@ ignore = [
105107
"TRY003",
106108
"E501",
107109
"DTZ",
110+
"PERF203", # `try`-`except` within a loop incurs performance overhead
111+
112+
# False positive
113+
"PERF401", # Use a list comprehension to create a transformed list
108114

109115
# Prefer autofix
110116
"PD011", # .to_numpy() instead of values
@@ -153,6 +159,10 @@ ignore = [
153159
"INP001",
154160
]
155161

162+
"popmon/config.py" = [
163+
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
164+
]
165+
156166
# Notebooks & NBQA
157167
"popmon/notebooks/*" = [
158168
# Imports cannot be checked properly with NBQA

0 commit comments

Comments
 (0)