From 80226ee0a8c2e309394bc7de13f0dba794e4fad6 Mon Sep 17 00:00:00 2001 From: Kirill Sosnovskikh Date: Thu, 27 Mar 2025 15:25:24 +0300 Subject: [PATCH] [#371] Add IAM and STS clients to boto3-stubs Signed-off-by: Kirill Sosnovskikh --- pyproject.toml | 2 +- requirements.txt | 4 ++-- src/frostfs_testlib/clients/s3/boto3_client.py | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2778f8a..d62f04b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dependencies = [ "pytest==7.1.2", "tenacity==8.0.1", "boto3==1.35.30", - "boto3-stubs[essential]==1.35.30", + "boto3-stubs[s3,iam,sts]==1.35.30", ] requires-python = ">=3.10" diff --git a/requirements.txt b/requirements.txt index a0bcc11..56d9b83 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ testrail-api==1.12.0 tenacity==8.0.1 pytest==7.1.2 boto3==1.35.30 -boto3-stubs[essential]==1.35.30 +boto3-stubs[s3,iam,sts]==1.35.30 pydantic==2.10.6 # Dev dependencies @@ -22,4 +22,4 @@ pylint==2.17.4 # Packaging dependencies build==0.8.0 setuptools==65.3.0 -twine==4.0.1 +twine==4.0.1 \ No newline at end of file diff --git a/src/frostfs_testlib/clients/s3/boto3_client.py b/src/frostfs_testlib/clients/s3/boto3_client.py index 0c4e8e4..ac4d55b 100644 --- a/src/frostfs_testlib/clients/s3/boto3_client.py +++ b/src/frostfs_testlib/clients/s3/boto3_client.py @@ -10,7 +10,9 @@ import boto3 import urllib3 from botocore.config import Config from botocore.exceptions import ClientError +from mypy_boto3_iam import IAMClient from mypy_boto3_s3 import S3Client +from mypy_boto3_sts import STSClient from frostfs_testlib import reporter from frostfs_testlib.clients.s3.interfaces import S3ClientWrapper, VersioningStatus, _make_objs_dict @@ -39,8 +41,8 @@ class Boto3ClientWrapper(S3ClientWrapper): self.boto3_client: S3Client = None self.iam_endpoint: str = "" - self.boto3_iam_client: S3Client = None - self.boto3_sts_client: S3Client = None + self.boto3_iam_client: IAMClient = None + self.boto3_sts_client: STSClient = None self.access_key_id = access_key_id self.secret_access_key = secret_access_key