mypy fixed
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
from __future__ import annotations
|
||||
import os
|
||||
from io import BytesIO
|
||||
from typing import TYPE_CHECKING
|
||||
import structlog
|
||||
from python_utils import check_env
|
||||
|
||||
@@ -11,6 +12,10 @@ from python_repositories.interfaces import (
|
||||
ConnectionAwareInterface,
|
||||
)
|
||||
|
||||
# Import for mypy type checking only
|
||||
if TYPE_CHECKING:
|
||||
from minio import Minio, S3Error
|
||||
|
||||
|
||||
class MinioAdapter(
|
||||
ContextAwareInterface,
|
||||
@@ -27,7 +32,7 @@ class MinioAdapter(
|
||||
def __init__(self) -> None:
|
||||
# Import here to avoid hard dependency if MinioAdapter is not used
|
||||
try:
|
||||
from minio import Minio, S3Error # type: ignore[import]
|
||||
from minio import Minio, S3Error
|
||||
except ImportError as e:
|
||||
raise RuntimeError("MinioAdapter dependencies missing") from e
|
||||
# Setup logger
|
||||
|
||||
Reference in New Issue
Block a user