Skip to content

Commit

Permalink
config update (#967)
Browse files Browse the repository at this point in the history
Co-authored-by: Jimmy Shen <v-jimshen@microsoft.com>
  • Loading branch information
jmmshn and jmmshn-ms authored Feb 21, 2025
1 parent f7a89d4 commit 82331b7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mp_api/client/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import List

from pydantic import Field
from pydantic_settings import BaseSettings
from pydantic_settings import SettingsConfigDict, BaseSettings
from pymatgen.core import _load_pmg_settings

from mp_api.client import __file__ as root_dir
Expand All @@ -26,6 +26,8 @@ class MAPIClientSettings(BaseSettings):
python module.
"""

model_config = ConfigDict(env_prefix="MPRESTER_")

TEST_FILES: str = Field(
os.path.join(os.path.dirname(os.path.abspath(root_dir)), "../../test_files"),
description="Directory with test files",
Expand Down Expand Up @@ -86,6 +88,4 @@ class MAPIClientSettings(BaseSettings):
MAX_LIST_LENGTH: int = Field(
_MAX_LIST_LENGTH, description="Maximum length of query parameter list"
)

class Config:
env_prefix = "MPRESTER_"
model_config = SettingsConfigDict(env_prefix="MPRESTER_")

0 comments on commit 82331b7

Please sign in to comment.