From 42e12e374cc9d8c2cd1d6a2a7ab3eac0dc7d96a5 Mon Sep 17 00:00:00 2001 From: Kamoltat Sirivadhna Date: Thu, 1 Feb 2024 18:04:37 -0500 Subject: [PATCH] setup.cfg & config.py: make sure we load_dotenv() 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 --- setup.cfg | 1 + src/teuthology_api/config.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/setup.cfg b/setup.cfg index b2a08ed..8184d65 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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] diff --git a/src/teuthology_api/config.py b/src/teuthology_api/config.py index 4d0a70c..377a2c6 100644 --- a/src/teuthology_api/config.py +++ b/src/teuthology_api/config.py @@ -1,5 +1,8 @@ from functools import lru_cache from pydantic_settings import BaseSettings, SettingsConfigDict +from dotenv import load_dotenv + +load_dotenv() class APISettings(BaseSettings):