Skip to content

Commit 82331b7

Browse files
jmmshnjmmshn-ms
andauthored
config update (#967)
Co-authored-by: Jimmy Shen <[email protected]>
1 parent f7a89d4 commit 82331b7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mp_api/client/core/settings.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import List
44

55
from pydantic import Field
6-
from pydantic_settings import BaseSettings
6+
from pydantic_settings import SettingsConfigDict, BaseSettings
77
from pymatgen.core import _load_pmg_settings
88

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

29+
model_config = ConfigDict(env_prefix="MPRESTER_")
30+
2931
TEST_FILES: str = Field(
3032
os.path.join(os.path.dirname(os.path.abspath(root_dir)), "../../test_files"),
3133
description="Directory with test files",
@@ -86,6 +88,4 @@ class MAPIClientSettings(BaseSettings):
8688
MAX_LIST_LENGTH: int = Field(
8789
_MAX_LIST_LENGTH, description="Maximum length of query parameter list"
8890
)
89-
90-
class Config:
91-
env_prefix = "MPRESTER_"
91+
model_config = SettingsConfigDict(env_prefix="MPRESTER_")

0 commit comments

Comments
 (0)