Skip to content

Commit

Permalink
fix: 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 ecfd7c5 commit 6c19baa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 3 additions & 2 deletions popmon/config.py
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
14 changes: 12 additions & 2 deletions pyproject.toml
Expand Up @@ -31,8 +31,10 @@ dependencies = [
"plotly>=5.8.0",
"joblib>=0.14.0",
"htmlmin",
"pydantic",
"typing_extensions"
"pydantic>=2",
"pydantic-settings",
"typing_extensions",
"tomli >= 1.1.0 ; python_version < '3.11'"
]
classifiers = [
"Programming Language :: Python :: 3",
Expand Down Expand Up @@ -105,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 @@ -153,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 6c19baa

Please sign in to comment.