Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add type hint for Minio.__init__ #1299

Merged
merged 10 commits into from
Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions minio/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,19 @@
from io import BytesIO
from random import random
from threading import Thread
from typing import BinaryIO
from typing import BinaryIO, TextIO
from urllib.parse import urlunsplit
from xml.etree import ElementTree as ET

import certifi
import urllib3
from urllib3 import PoolManager
from urllib3._collections import HTTPHeaderDict

from . import __title__, __version__, time
from .commonconfig import COPY, REPLACE, ComposeSource, CopySource, Tags
from .credentials import StaticProvider
from .credentials.providers import Provider
from .datatypes import (CompleteMultipartUploadResult, EventIterable,
ListAllMyBucketsResult, ListMultipartUploadsResult,
ListPartsResult, Object, Part, PostPolicy,
Expand Down Expand Up @@ -113,16 +115,26 @@ class Minio: # pylint: disable=too-many-public-methods
object in each process, and not share it between processes.

"""
_region_map: dict[str, str]
_base_url: BaseURL
_user_agent: str
_trace_stream: TextIO | None
_provider: Provider | None
_http: PoolManager

# pylint: disable=too-many-function-args
def __init__(self, endpoint, access_key=None,
secret_key=None,
session_token=None,
secure=True,
region=None,
http_client=None,
credentials=None,
cert_check=True):
def __init__(
balamurugana marked this conversation as resolved.
Show resolved Hide resolved
self,
endpoint: str,
access_key: str | None = None,
secret_key: str | None = None,
session_token: str | None = None,
secure: bool = True,
region: str | None = None,
http_client: urllib3.PoolManager | None = None,
credentials: Provider | None = None,
cert_check: bool = True
):
# Validate http client has correct base class.
if http_client and not isinstance(
http_client,
Expand Down