Skip to content

Commit 7ea7d92

Browse files
Merge branch 'release-0.13.1'
* release-0.13.1: Bumping version to 0.13.1 Add official Python 3.14 support with first release candidate (#353) Updates based on feedback Add ruff reformatting Update utils.py Update utils.py Create nested client method Replace bespoke NullHandler with Python's impl (#351) Update test_futures.py Format code with latest changes Update dependency versions and ruff hook Typo Fix (#349) Update test runners to test 3.14 beta build (#348) Avoid the multiprocessing forkserver method
2 parents 90a897b + 5a93968 commit 7ea7d92

16 files changed

Lines changed: 60 additions & 25 deletions

File tree

.changes/0.13.1.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
{
3+
"category": "Python",
4+
"description": "Added provisional support for the upcoming Python 3.14 release",
5+
"type": "enhancement"
6+
}
7+
]

.github/workflows/run-crt-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
15+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev"]
1616
os: [ubuntu-latest, macOS-latest, windows-latest]
1717

1818
steps:

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
18+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev"]
1919
os: [ubuntu-latest, macOS-latest, windows-latest]
2020

2121
steps:

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
exclude: ^(.changes/|CHANGELOG.rst|s3transfer/compat.py)
22
repos:
33
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
4-
rev: v4.5.0
4+
rev: v5.0.0
55
hooks:
66
- id: check-yaml
77
- id: end-of-file-fixer
88
- id: trailing-whitespace
99
- repo: https://github.com/astral-sh/ruff-pre-commit
10-
rev: v0.4.8
10+
rev: v0.12.0
1111
hooks:
12-
- id: ruff
12+
- id: ruff-check
1313
args: [ --fix ]
1414
- id: ruff-format

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
CHANGELOG
33
=========
44

5+
0.13.1
6+
======
7+
8+
* enhancement:Python: Added provisional support for the upcoming Python 3.14 release
9+
10+
511
0.13.0
612
======
713

s3transfer/__init__.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ def __call__(self, bytes_amount):
134134
import socket
135135
import string
136136
import threading
137+
from logging import NullHandler
137138

138139
from botocore.compat import six # noqa: F401
139140
from botocore.exceptions import IncompleteReadError, ResponseStreamingError
@@ -145,12 +146,7 @@ def __call__(self, bytes_amount):
145146
from s3transfer.exceptions import RetriesExceededError, S3UploadFailedError
146147

147148
__author__ = 'Amazon Web Services'
148-
__version__ = '0.13.0'
149-
150-
151-
class NullHandler(logging.Handler):
152-
def emit(self, record):
153-
pass
149+
__version__ = '0.13.1'
154150

155151

156152
logger = logging.getLogger(__name__)
@@ -513,7 +509,7 @@ def put(self, item):
513509
with self._shutdown_lock:
514510
if self._shutdown:
515511
raise QueueShutdownError(
516-
"Cannot put item to queue when " "queue has been shutdown."
512+
"Cannot put item to queue when queue has been shutdown."
517513
)
518514
return queue.Queue.put(self, item)
519515

@@ -800,8 +796,7 @@ def download_file(
800796
)
801797
except Exception:
802798
logger.debug(
803-
"Exception caught in download_file, removing partial "
804-
"file: %s",
799+
"Exception caught in download_file, removing partial file: %s",
805800
temp_filename,
806801
exc_info=True,
807802
)

s3transfer/crt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
from s3transfer.utils import (
4747
CallArgs,
4848
OSUtils,
49+
create_nested_client,
4950
get_callbacks,
5051
is_s3express_bucket,
5152
)
@@ -481,7 +482,7 @@ def __init__(self, session, client_kwargs=None):
481482
if client_kwargs is None:
482483
client_kwargs = {}
483484
self._resolve_client_config(session, client_kwargs)
484-
self._client = session.create_client(**client_kwargs)
485+
self._client = create_nested_client(session, **client_kwargs)
485486
self._client.meta.events.register(
486487
'request-created.s3.*', self._capture_http_request
487488
)

s3transfer/manager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,9 @@ def _validate_all_known_args(self, actual, allowed):
514514
for kwarg in actual:
515515
if kwarg not in allowed:
516516
raise ValueError(
517-
"Invalid extra_args key '{}', "
518-
"must be one of: {}".format(kwarg, ', '.join(allowed))
517+
"Invalid extra_args key '{}', must be one of: {}".format(
518+
kwarg, ', '.join(allowed)
519+
)
519520
)
520521

521522
def _add_operation_defaults(self, extra_args):

s3transfer/processpool.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@
214214
OSUtils,
215215
calculate_num_parts,
216216
calculate_range_parameter,
217+
create_nested_client,
217218
)
218219

219220
logger = logging.getLogger(__name__)
@@ -577,9 +578,8 @@ def __init__(self, client_kwargs=None):
577578

578579
def create_client(self):
579580
"""Create a botocore S3 client"""
580-
return botocore.session.Session().create_client(
581-
's3', **self._client_kwargs
582-
)
581+
session = botocore.session.Session()
582+
return create_nested_client(session, 's3', **self._client_kwargs)
583583

584584

585585
class TransferMonitor:

s3transfer/subscribers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class BaseSubscriber:
2020
"""The base subscriber class
2121
2222
It is recommended that all subscriber implementations subclass and then
23-
override the subscription methods (i.e. on_{subsribe_type}() methods).
23+
override the subscription methods (i.e. on_{subscribe_type}() methods).
2424
"""
2525

2626
VALID_SUBSCRIBER_TYPES = ['queued', 'progress', 'done']

0 commit comments

Comments
 (0)