Skip to content

Commit 196b8bb

Browse files
committed
Bump botocore dependency specification
1 parent d110764 commit 196b8bb

File tree

10 files changed

+60
-40
lines changed

10 files changed

+60
-40
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.3", # 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.3",
4545
]
4646
boto3 = [
47-
"boto3 >= 1.39.15, < 1.40.2",
47+
"boto3 >= 1.40.2, < 1.40.3",
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
)

uv.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)