Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 6 additions & 5 deletions dimfred/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import os
from typing import Union

from pydantic import BaseSettings, root_validator
from pydantic import model_validator
from pydantic_settings import BaseSettings, SettingsConfigDict


################################################################################
Expand Down Expand Up @@ -42,11 +43,11 @@ def _load_list(self, l):
# CONFIG
################################################################################
class BaseConfig(BaseSettings):
class Config:
env_file = f"config_{os.environ['APP_CONFIG']}.env"
env_file_encoding = "utf-8"
model_config = SettingsConfigDict(
env_file=f"config_{os.environ['APP_CONFIG']}.env", env_file_encoding="utf-8"
)

@root_validator
@model_validator(mode="before")
def parse_abis(cls, values):
for k, v in values.items():
if "_abi" in k or "_ABI" in k:
Expand Down
Loading