From: Michael R. Crusoe <crusoe@debian.org>
Subject: avoid an unnecessary mypy_boto3_s3 import
--- toil.orig/src/toil/jobStores/aws/utils.py
+++ toil/src/toil/jobStores/aws/utils.py
@@ -17,13 +17,12 @@
 import os
 import types
 from ssl import SSLError
-from typing import Optional, cast
+from typing import Optional, cast, TYPE_CHECKING
 
 from boto3.s3.transfer import TransferConfig
 from boto.exception import BotoServerError, S3ResponseError, SDBResponseError
 from botocore.client import Config
 from botocore.exceptions import ClientError
-from mypy_boto3_s3 import S3Client, S3ServiceResource
 
 from toil.lib.aws import session
 from toil.lib.aws.utils import connection_reset, get_bucket_region
@@ -36,6 +35,8 @@
                             get_error_status,
                             old_retry,
                             retry)
+if TYPE_CHECKING:
+    from mypy_boto3_s3 import S3Client, S3ServiceResource
 
 logger = logging.getLogger(__name__)
 
@@ -291,7 +292,7 @@
     error=ClientError,
     error_codes=[404, 500, 502, 503, 504]
 )])
-def copyKeyMultipart(resource: S3ServiceResource,
+def copyKeyMultipart(resource: "S3ServiceResource",
                      srcBucketName: str,
                      srcKeyName: str,
                      srcKeyVersion: str,
@@ -347,7 +348,7 @@
     # not wherever the bucket virtual hostnames go.
     source_region = get_bucket_region(srcBucketName)
     source_client = cast(
-        S3Client,
+        "S3Client",
         session.client(
             's3',
             region_name=source_region,
