Skip to content

Commit 05b60c9

Browse files
committed
Bump botocore dependency specification
1 parent d110764 commit 05b60c9

File tree

11 files changed

+69
-53
lines changed

11 files changed

+69
-53
lines changed

aiobotocore/discovery.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ async def describe_endpoint(self, **kwargs):
3333
if not self._always_discover and not discovery_required:
3434
# Discovery set to only run on required operations
3535
logger.debug(
36-
f'Optional discovery disabled. Skipping discovery for Operation: {operation}'
36+
'Optional discovery disabled. Skipping discovery for Operation: %s',
37+
operation,
3738
)
3839
return None
3940

aiobotocore/httpchecksum.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ async def handle_checksum_body(
196196
return
197197

198198
logger.debug(
199-
f'Skipping checksum validation. Response did not contain one of the '
200-
f'following algorithms: {algorithms}.'
199+
'Skipping checksum validation. Response did not contain one of the following algorithms: %s.',
200+
algorithms,
201201
)
202202

203203

aiobotocore/regions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async def construct_endpoint(
2727
operation_model, call_args, request_context
2828
)
2929
LOG.debug(
30-
f'Calling endpoint provider with parameters: {provider_params}'
30+
'Calling endpoint provider with parameters: %s', provider_params
3131
)
3232
try:
3333
provider_result = self._provider.resolve_endpoint(
@@ -41,7 +41,7 @@ async def construct_endpoint(
4141
raise
4242
else:
4343
raise botocore_exception from ex
44-
LOG.debug(f'Endpoint provider result: {provider_result.url}')
44+
LOG.debug('Endpoint provider result: %s', provider_result.url)
4545

4646
# The endpoint provider does not support non-secure transport.
4747
if not self._use_ssl and provider_result.url.startswith('https://'):

aiobotocore/session.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,9 @@ async def _create_client(
191191
aws_session_token, aws_account_id
192192
):
193193
logger.debug(
194-
f"Ignoring the following credential-related values which were set without "
195-
f"an access key id and secret key on the session or client: {ignored_credentials}"
194+
"Ignoring the following credential-related values which were set without "
195+
"an access key id and secret key on the session or client: %s",
196+
ignored_credentials,
196197
)
197198
credentials = await self.get_credentials()
198199
auth_token = self.get_auth_token()

aiobotocore/signers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import botocore
44
import botocore.auth
5+
from botocore.compat import get_current_datetime
56
from botocore.exceptions import ParamValidationError, UnknownClientMethodError
67
from botocore.signers import (
78
RequestSigner,
@@ -368,7 +369,7 @@ async def generate_presigned_post(
368369
policy = {}
369370

370371
# Create an expiration date for the policy
371-
datetime_now = datetime.datetime.utcnow()
372+
datetime_now = get_current_datetime()
372373
expire_date = datetime_now + datetime.timedelta(seconds=expires_in)
373374
policy['expiration'] = expire_date.strftime(botocore.auth.ISO8601)
374375

aiobotocore/tokens.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ async def _refresh_access_token(self, token):
125125

126126
expiry = dateutil.parser.parse(token["registrationExpiresAt"])
127127
if total_seconds(expiry - self._now()) <= 0:
128-
logger.info(f"SSO token registration expired at {expiry}")
128+
logger.info("SSO token registration expired at %s", expiry)
129129
return None
130130

131131
try:
@@ -137,10 +137,10 @@ async def _refresh_access_token(self, token):
137137
async def _refresher(self):
138138
start_url = self._sso_config["sso_start_url"]
139139
session_name = self._sso_config["session_name"]
140-
logger.info(f"Loading cached SSO token for {session_name}")
140+
logger.info("Loading cached SSO token for %s", session_name)
141141
token_dict = self._token_loader(start_url, session_name=session_name)
142142
expiration = dateutil.parser.parse(token_dict["expiresAt"])
143-
logger.debug(f"Cached SSO token expires at {expiration}")
143+
logger.debug("Cached SSO token expires at %s", expiration)
144144

145145
remaining = total_seconds(expiration - self._now())
146146
if remaining < self._REFRESH_WINDOW:

aiobotocore/utils.py

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -486,16 +486,21 @@ async def redirect_from_error(
486486

487487
if new_region is None:
488488
logger.debug(
489-
f"S3 client configured for region {client_region} but the "
490-
f"bucket {bucket} is not in that region and the proper region "
491-
"could not be automatically determined."
489+
"S3 client configured for region %s but the "
490+
"bucket %s is not in that region and the proper region "
491+
"could not be automatically determined.",
492+
client_region,
493+
bucket,
492494
)
493495
return
494496

495497
logger.debug(
496-
f"S3 client configured for region {client_region} but the bucket {bucket} "
497-
f"is in region {new_region}; Please configure the proper region to "
498-
f"avoid multiple unnecessary redirects and signing attempts."
498+
"S3 client configured for region %s but the bucket %s "
499+
"is in region %s; Please configure the proper region to "
500+
"avoid multiple unnecessary redirects and signing attempts.",
501+
client_region,
502+
bucket,
503+
new_region,
499504
)
500505
# Adding the new region to _cache will make construct_endpoint() to
501506
# use the new region as value for the AWS::Region builtin parameter.
@@ -622,16 +627,21 @@ async def redirect_from_error(
622627

623628
if new_region is None:
624629
logger.debug(
625-
f"S3 client configured for region {client_region} but the bucket {bucket} is not "
630+
"S3 client configured for region %s but the bucket %s is not "
626631
"in that region and the proper region could not be "
627-
"automatically determined."
632+
"automatically determined.",
633+
client_region,
634+
bucket,
628635
)
629636
return
630637

631638
logger.debug(
632-
f"S3 client configured for region {client_region} but the bucket {bucket} is in region"
633-
f" {new_region}; Please configure the proper region to avoid multiple "
634-
"unnecessary redirects and signing attempts."
639+
"S3 client configured for region %s but the bucket %s is in region"
640+
" %s; Please configure the proper region to avoid multiple "
641+
"unnecessary redirects and signing attempts.",
642+
client_region,
643+
bucket,
644+
new_region,
635645
)
636646
endpoint = self._endpoint_resolver.resolve('s3', new_region)
637647
endpoint = endpoint['endpoint_url']

pyproject.toml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dynamic = ["version", "readme"]
3232
dependencies = [
3333
"aiohttp >= 3.9.2, < 4.0.0",
3434
"aioitertools >= 0.5.1, < 1.0.0",
35-
"botocore >= 1.39.15, < 1.40.2", # NOTE: When updating, always keep `project.optional-dependencies` aligned
35+
"botocore >= 1.40.2, < 1.40.6", # NOTE: When updating, always keep `project.optional-dependencies` aligned
3636
"python-dateutil >= 2.1, < 3.0.0",
3737
"jmespath >= 0.7.1, < 2.0.0",
3838
"multidict >= 6.0.0, < 7.0.0",
@@ -41,10 +41,10 @@ dependencies = [
4141

4242
[project.optional-dependencies]
4343
awscli = [
44-
"awscli >= 1.41.15, < 1.42.2",
44+
"awscli >= 1.42.2, < 1.42.6",
4545
]
4646
boto3 = [
47-
"boto3 >= 1.39.15, < 1.40.2",
47+
"boto3 >= 1.40.2, < 1.40.6",
4848
]
4949
httpx = [
5050
"httpx >= 0.25.1, < 0.29"
@@ -145,10 +145,17 @@ indent-width = 4
145145
target-version = "py39"
146146

147147
[tool.ruff.lint]
148-
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
149148
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
150149
# McCabe complexity (`C901`) by default.
151-
select = ["E4", "E7", "E9", "F", "I", "UP"]
150+
select = [
151+
"E4", # pycodestyle
152+
"E7", # pycodestyle
153+
"E9", # pycodestyle
154+
"F", # Pyflakes
155+
"I", # Import sorting
156+
"UP", # PyUpgrade
157+
"G", # Log formatting
158+
]
152159
ignore = []
153160

154161
# Allow fix for all enabled rules (when `--fix`) is provided.

tests/botocore_tests/unit/test_signers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async def test_signers_generate_db_auth_token(rds_client):
4444
clock = datetime.datetime(2016, 11, 7, 17, 39, 33, tzinfo=timezone.utc)
4545

4646
with mock.patch('datetime.datetime') as dt:
47-
dt.utcnow.return_value = clock
47+
dt.now.return_value = clock
4848
result = await aiobotocore.signers.generate_db_auth_token(
4949
rds_client, hostname, port, username
5050
)

tests/test_patches.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -907,8 +907,7 @@ def test_protocol_parsers():
907907
(
908908
EndpointRulesetResolver.construct_endpoint,
909909
{
910-
'ccbed61e316a0e92e1d0f67c554ee15efa4ee6b8',
911-
'ab22bb1ec171713e548567fbe84dd88a3d5f4b76',
910+
'f3ad94494006fcfdbd622f6c19e0de9fba0ad199',
912911
},
913912
),
914913
(
@@ -928,7 +927,7 @@ def test_protocol_parsers():
928927
(
929928
StreamingBody,
930929
{
931-
'e6f0cb3b61c8b0a7c6961e77949e27c520b30a5c',
930+
'e358f72191c4c1cb37d8fe90871342abf79afde2',
932931
},
933932
),
934933
(
@@ -1065,8 +1064,7 @@ def test_protocol_parsers():
10651064
(
10661065
S3PostPresigner.generate_presigned_post,
10671066
{
1068-
'269efc9af054a2fd2728d5b0a27db82c48053d7f',
1069-
'48418dc6c9b04fdc8689c7cb5b6eb987321a84e3',
1067+
'01c61dc0f33392a19def738afc634f5def401e32',
10701068
},
10711069
),
10721070
(
@@ -1158,13 +1156,13 @@ def test_protocol_parsers():
11581156
(
11591157
SSOTokenProvider._refresh_access_token,
11601158
{
1161-
'cb179d1f262e41cc03a7c218e624e8c7fbeeaf19',
1159+
'6263c009e6d86011ca1226d61ea95163bbfca258',
11621160
},
11631161
),
11641162
(
11651163
SSOTokenProvider._refresher,
11661164
{
1167-
'824d41775dbb8a05184f6e9c7b2ea7202b72f2a9',
1165+
'd89b3446344826e5b740840c12fd9279810c45d2',
11681166
},
11691167
),
11701168
(
@@ -1285,7 +1283,7 @@ def test_protocol_parsers():
12851283
(
12861284
S3RegionRedirectorv2.redirect_from_error,
12871285
{
1288-
'8e3003ec881c7eab0945fe4b6e021ca488fbcd78',
1286+
'2a715115e94bddcea4cce936bf7c7013f1f6ecdf',
12891287
},
12901288
),
12911289
(
@@ -1297,8 +1295,7 @@ def test_protocol_parsers():
12971295
(
12981296
S3RegionRedirector.redirect_from_error,
12991297
{
1300-
'3863b2c6472513b7896bfccc9dfd2567c472f441',
1301-
'e1d93a4a85dfbfa810b9249da0b22ce14744b99d',
1298+
'5db904d0311db5c875aed0f6a78278f173ca40a7',
13021299
},
13031300
),
13041301
(
@@ -1428,8 +1425,7 @@ def test_protocol_parsers():
14281425
(
14291426
EndpointDiscoveryManager.describe_endpoint,
14301427
{
1431-
'b2f1b29177cf30f299e61b85ddec09eaa070e54e',
1432-
'cbd237b874daef01cf7be82fef30516557ba17f9',
1428+
'2d7c40eec571a14e6e3968b710c23677ae3685e6',
14331429
},
14341430
),
14351431
(
@@ -1524,7 +1520,7 @@ def test_protocol_parsers():
15241520
(
15251521
handle_checksum_body,
15261522
{
1527-
'040cb48d8ebfb5ca195d41deb55b38d1fcb489f8',
1523+
'f019114f7fc3a4e200157b9689ed8a1cc9d72825',
15281524
},
15291525
),
15301526
(

0 commit comments

Comments
 (0)