moved import of optional packages into classes
Code Quality Pipeline / code-quality (pull_request) Failing after 1m53s
Test Python Package / test (pull_request) Failing after 22s

This commit is contained in:
Brian Bjarke Jensen
2025-09-17 11:44:47 +02:00
parent 0ca07c02ac
commit ee6acc6791
2 changed files with 11 additions and 7 deletions
@@ -3,10 +3,7 @@
from __future__ import annotations
import os
from io import BytesIO
import structlog
from minio import Minio, S3Error
from python_utils import check_env
from python_repositories.interfaces import (
@@ -28,6 +25,11 @@ class MinioAdapter(
chunk_size: int = 5 * 2**20 # 5 MiB
def __init__(self) -> None:
# Import here to avoid hard dependency if MinioAdapter is not used
try:
from minio import Minio, S3Error # type: ignore[import]
except ImportError as e:
raise RuntimeError("MinioAdapter dependencies missing") from e
# Setup logger
self.logger = structlog.get_logger(
self.__class__.__name__,