Skip to content

Commit

Permalink
upgrade to pydantic 2
Browse files Browse the repository at this point in the history
Closes #274
  • Loading branch information
sbrugman committed Jul 6, 2023
1 parent 607617e commit 2507eba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 3 additions & 2 deletions popmon/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

import pandas as pd
from histogrammar.dfinterface.make_histograms import get_time_axes
from pydantic import BaseModel, BaseSettings
from pydantic import BaseModel
from pydantic_settings import BaseSettings
from typing_extensions import Literal

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

class ValidatedSettings(BaseSettings):
class Config:
validate_all = True
validate_default = True
validate_assignment = True


Expand Down
11 changes: 10 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ dependencies = [
"plotly>=5.8.0",
"joblib>=0.14.0",
"htmlmin",
"pydantic",
"pydantic>=2",
"pydantic-settings",
"typing_extensions",
"tomli >= 1.1.0 ; python_version < '3.11'"
]
Expand Down Expand Up @@ -106,6 +107,10 @@ ignore = [
"TRY003",
"E501",
"DTZ",
"PERF203", # `try`-`except` within a loop incurs performance overhead

# False positive
"PERF401", # Use a list comprehension to create a transformed list

# Prefer autofix
"PD011", # .to_numpy() instead of values
Expand Down Expand Up @@ -154,6 +159,10 @@ ignore = [
"INP001",
]

"popmon/config.py" = [
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
]

# Notebooks & NBQA
"popmon/notebooks/*" = [
# Imports cannot be checked properly with NBQA
Expand Down

0 comments on commit 2507eba

Please sign in to comment.