feat(common): add get_repo_dir function and corresponding tests
treefmt / nix fmt (pull_request) Successful in 5s
pytest / pytest (pull_request) Successful in 24s
build_systems / build-brain (pull_request) Successful in 44s
build_systems / build-bob (pull_request) Successful in 44s
build_systems / build-rhapsody-in-green (pull_request) Successful in 57s
build_systems / build-jeeves (pull_request) Successful in 2m17s
treefmt / nix fmt (push) Successful in 5s
build_systems / build-brain (push) Successful in 8s
pytest / pytest (push) Successful in 23s
build_systems / build-bob (push) Successful in 30s
build_systems / build-rhapsody-in-green (push) Successful in 42s
build_systems / build-jeeves (push) Successful in 2m2s
treefmt / nix fmt (pull_request) Successful in 5s
pytest / pytest (pull_request) Successful in 24s
build_systems / build-brain (pull_request) Successful in 44s
build_systems / build-bob (pull_request) Successful in 44s
build_systems / build-rhapsody-in-green (pull_request) Successful in 57s
build_systems / build-jeeves (pull_request) Successful in 2m17s
treefmt / nix fmt (push) Successful in 5s
build_systems / build-brain (push) Successful in 8s
pytest / pytest (push) Successful in 23s
build_systems / build-bob (push) Successful in 30s
build_systems / build-rhapsody-in-green (push) Successful in 42s
build_systems / build-jeeves (push) Successful in 2m2s
This commit was merged in pull request #41.
This commit is contained in:
@@ -4,6 +4,7 @@ from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
from subprocess import PIPE, Popen
|
||||
|
||||
from python.logging_config import configure_logger as _configure_logger
|
||||
@@ -11,6 +12,11 @@ from python.logging_config import configure_logger as _configure_logger
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def get_repo_dir() -> Path:
|
||||
"""Return the repository root directory."""
|
||||
return Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def configure_logger(level: str = "INFO") -> None:
|
||||
"""Configure the logger."""
|
||||
_configure_logger(level)
|
||||
|
||||
@@ -14,7 +14,7 @@ from typing import Annotated
|
||||
|
||||
import typer
|
||||
|
||||
from python.common import configure_logger
|
||||
from python.common import configure_logger, get_repo_dir
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -24,7 +24,7 @@ class Config:
|
||||
|
||||
image_tag = "whisper-transcribe:latest"
|
||||
model_volume = "whisper-models"
|
||||
repo_root = Path(__file__).resolve().parents[3]
|
||||
repo_root = get_repo_dir()
|
||||
dockerfile = Path(__file__).resolve().parent / "Dockerfile"
|
||||
huggingface_cache = "/root/.cache/huggingface"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user