Skip to content

Commit

Permalink
setup.cfg & config.py: make sure we load_dotenv()
Browse files Browse the repository at this point in the history
Currently, setup.cfg doesn't have python-dotenv
as a required dependency so we add that.

Moreover, in config.py we didn't really
load_dotenv() so we didn't actually load
.env into pydantic_settings

Signed-off-by: Kamoltat Sirivadhna <[email protected]>
  • Loading branch information
kamoltat committed Feb 1, 2024
1 parent 9af7fb0 commit 1fb2f3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ install_requires =
httpx
itsdangerous
pydantic-settings
python-dotenv
# Temporarily, using teuthology without monkey patching the thread
teuthology @ git+https://github.com/ceph/teuthology@teuth-api#egg=teuthology[test]"
# Original: git+https://github.com/ceph/teuthology#egg=teuthology[test]
Expand Down
3 changes: 2 additions & 1 deletion src/teuthology_api/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from functools import lru_cache
from pydantic_settings import BaseSettings, SettingsConfigDict

from dotenv import load_dotenv
load_dotenv()

class APISettings(BaseSettings):
"""
Expand Down

0 comments on commit 1fb2f3c

Please sign in to comment.