Skip to content

Commit

Permalink
Merge pull request #4 from Devansh3712/main
Browse files Browse the repository at this point in the history
src/config.py: Update pydantic to pydantic-settings
Reviewed-by: Kamoltat Sirivadhna <[email protected]>
  • Loading branch information
kamoltat authored Jul 17, 2023
2 parents 2bcd3fd + 542890a commit eccb49b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gunicorn
httpx
itsdangerous
black
pydantic-settings
# Temporarily, using teuthology without monkey patching the thread
git+https://github.com/VallariAg/teuthology@teuth-api#egg=teuthology[test]
# Original: git+https://github.com/ceph/teuthology#egg=teuthology[test]
12 changes: 2 additions & 10 deletions src/config.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
from functools import lru_cache
from pydantic import BaseSettings
from pydantic_settings import BaseSettings, SettingsConfigDict


class APISettings(BaseSettings):
"""
Class for API settings.
"""

model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")
PADDLES_URL: str = "http://paddles:8080"
# TODO: team names need to be changed below when created
admin_team: str = "ceph" # ceph's github team with *sudo* access to sepia
teuth_team: str = "teuth" # ceph's github team with access to sepia

class Config:
"""
Class for Config.
"""

# pylint: disable=too-few-public-methods
env_file = ".env"
env_file_encoding = "utf-8"


@lru_cache()
def get_api_settings() -> APISettings:
Expand Down

0 comments on commit eccb49b

Please sign in to comment.