diff --git a/Makefile b/Makefile index a01c9de..6364bb0 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ build-dep-fed: python3-defusedxml \ python3-requests \ python3-dateutil \ - python3-boto3 \ + python3-botocore \ python3-lxml test: copyright lint unittest diff --git a/requirements.txt b/requirements.txt index a2d88aa..a196c9d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ defusedxml requests python-dateutil -boto3 +botocore lxml diff --git a/rpm_s3_mirror.spec b/rpm_s3_mirror.spec index ecee73a..f934745 100644 --- a/rpm_s3_mirror.spec +++ b/rpm_s3_mirror.spec @@ -11,7 +11,7 @@ BuildRequires: rpm-build Requires: python3-defusedxml Requires: python3-requests Requires: python3-dateutil -Requires: python3-boto3 +Requires: python3-botocore Requires: python3-lxml Requires: systemd Requires: zchunk diff --git a/rpm_s3_mirror/s3.py b/rpm_s3_mirror/s3.py index ea3f6ef..5c892d3 100644 --- a/rpm_s3_mirror/s3.py +++ b/rpm_s3_mirror/s3.py @@ -13,7 +13,7 @@ from typing import Collection, Union, BinaryIO, Dict, Iterable from urllib.parse import urlparse -import boto3 +import botocore.session import botocore.exceptions import time @@ -220,7 +220,8 @@ def _client(self): if self._s3 is None: # The boto3 client call is not threadsafe, so only allow calling it from a singe thread at a time with lock: - self._s3 = boto3.client( + botocore_session = botocore.session.get_session() + self._s3 = botocore_session.create_client( "s3", region_name=self.bucket_region, aws_access_key_id=self.aws_access_key_id, diff --git a/setup.py b/setup.py index d986985..d764474 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ "defusedxml", "requests", "python-dateutil", - "boto3", + "botocore", "lxml", ], entry_points={