Skip to content

Commit

Permalink
Remove use of deprecated "path"
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddasol committed Jan 16, 2025
1 parent bced94f commit 222d797
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/isar_robot/config/settings.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import importlib.resources as pkg_resources

from importlib.resources import as_file, files
from pydantic import Field
from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
def __init__(self) -> None:
try:
with pkg_resources.path("isar_robot.config", "settings.env") as path:
env_file_path = path
source = files("isar_robot").joinpath("config").joinpath("settings.env")
with as_file(source) as eml:
env_file = eml
except ModuleNotFoundError:
env_file_path = None
super().__init__(_env_file=env_file_path)
env_file = None
super().__init__(_env_file=env_file)

STEP_DURATION_IN_SECONDS: float = Field(default=5.0)
MISSION_DURATION_IN_SECONDS: float = Field(default=5.0)
Expand Down

0 comments on commit 222d797

Please sign in to comment.