feat: Refactor path properties in Settings class to use proj_root
This commit is contained in:
parent
3ac432567b
commit
5e5f14f5fa
|
|
@ -42,33 +42,39 @@ class Settings(BaseSettings):
|
|||
extra="ignore",
|
||||
)
|
||||
|
||||
@property
|
||||
def proj_root(self) -> Path:
|
||||
return Path(__file__).resolve().parents[1]
|
||||
|
||||
@property
|
||||
def data_path(self) -> Path:
|
||||
return Path(self.data_path_)
|
||||
proj_root = self.proj_root
|
||||
return proj_root / self.data_path_
|
||||
|
||||
@property
|
||||
def models_path(self) -> Path:
|
||||
return Path(self.models_path_)
|
||||
proj_root = self.proj_root
|
||||
return proj_root / self.models_path_
|
||||
|
||||
@property
|
||||
def processed_path(self) -> Path:
|
||||
return Path(self.processed_path_)
|
||||
proj_root = self.proj_root
|
||||
return proj_root / self.processed_path_
|
||||
|
||||
@property
|
||||
def raw_path(self) -> Path:
|
||||
return Path(self.raw_path_)
|
||||
proj_root = self.proj_root
|
||||
return proj_root / self.raw_path_
|
||||
|
||||
@property
|
||||
def interim_path(self) -> Path:
|
||||
return Path(self.interim_path_)
|
||||
proj_root = self.proj_root
|
||||
return proj_root / self.interim_path_
|
||||
|
||||
@property
|
||||
def external_path(self) -> Path:
|
||||
return Path(self.external_path_)
|
||||
|
||||
@property
|
||||
def proj_root(self) -> Path:
|
||||
return Path(__file__).resolve().parents[1]
|
||||
proj_root = self.proj_root
|
||||
return proj_root / self.external_path_
|
||||
|
||||
@property
|
||||
def database_url(self) -> str:
|
||||
|
|
@ -144,7 +150,7 @@ class Settings(BaseSettings):
|
|||
|
||||
@property
|
||||
def kubeconfig_path(self) -> Path:
|
||||
return Path(self.kubeconfig_path)
|
||||
|
||||
proj_root = self.proj_root
|
||||
return proj_root / self.kubeconfig_path
|
||||
|
||||
settings = Settings()
|
||||
Loading…
Reference in New Issue