Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
heltluke committed Jan 5, 2024
1 parent 337e582 commit 3df35fe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ python-dotenv==0.21.1
fire==0.4.0
numpy==1.21.3
pydantic==2.4
pydantic-settings>=0.2.5
python-dateutil==2.8.2
requests==2.31.0
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"fire",
"numpy",
"pydantic",
"pydantic-settings",
"python-dateutil",
"requests",
]
Expand Down
10 changes: 6 additions & 4 deletions xcc/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from appdirs import user_config_dir
from dotenv import dotenv_values, set_key, unset_key
from pydantic_settings import BaseSettings, SettingsConfigDict
from pydantic.v1 import BaseSettings

# Matches when string contains chars outside Base64URL set
# https://base64.guru/standards/base64url
Expand Down Expand Up @@ -108,9 +108,11 @@ class Settings(BaseSettings):

TLS: bool = True
"""Whether to use HTTPS for requests to the Xanadu Cloud."""
model_config = SettingsConfigDict(
case_sensitive=True, env_file=get_path_to_env_file(), env_prefix=get_name_of_env_var()
)

class Config: # pylint: disable=missing-class-docstring
case_sensitive = True
env_file = get_path_to_env_file()
env_prefix = get_name_of_env_var()

def save(self) -> None:
"""Saves the current settings to the .env file."""
Expand Down

0 comments on commit 3df35fe

Please sign in to comment.