Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trim now unneeded usage of botocore.compat shim #3383

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion botocore/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import copy
from collections import OrderedDict

from botocore.compat import OrderedDict
from botocore.endpoint import DEFAULT_TIMEOUT, MAX_POOL_CONNECTIONS
from botocore.exceptions import (
InvalidMaxRetryAttemptsError,
Expand Down
2 changes: 1 addition & 1 deletion botocore/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ def _retrieve_credentials_using(self, credential_process):
raise CredentialRetrievalError(
provider=self.METHOD, error_msg=stderr.decode('utf-8')
)
parsed = botocore.compat.json.loads(stdout.decode('utf-8'))
parsed = json.loads(stdout.decode('utf-8'))
version = parsed.get('Version', '<Version key not provided>')
if version != 1:
raise CredentialRetrievalError(
Expand Down
2 changes: 1 addition & 1 deletion botocore/docs/bcdoc/restdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import logging
import os
import re
from collections import OrderedDict

from botocore.compat import OrderedDict
from botocore.docs.bcdoc.docstringparser import DocStringParser
from botocore.docs.bcdoc.style import ReSTStyle

Expand Down
2 changes: 1 addition & 1 deletion botocore/docs/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import os
from collections import OrderedDict

from botocore import xform_name
from botocore.compat import OrderedDict
from botocore.docs.bcdoc.restdoc import DocumentStructure
from botocore.docs.example import ResponseExampleDocumenter
from botocore.docs.method import (
Expand Down
2 changes: 1 addition & 1 deletion botocore/docs/paginator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import os
from collections import OrderedDict

from botocore import xform_name
from botocore.compat import OrderedDict
from botocore.docs.bcdoc.restdoc import DocumentStructure
from botocore.docs.method import document_model_driven_method
from botocore.docs.utils import DocumentedShape
Expand Down
2 changes: 1 addition & 1 deletion botocore/docs/waiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import os
from collections import OrderedDict

from botocore import xform_name
from botocore.compat import OrderedDict
from botocore.docs.bcdoc.restdoc import DocumentStructure
from botocore.docs.method import document_model_driven_method
from botocore.docs.utils import DocumentedShape
Expand Down
4 changes: 3 additions & 1 deletion botocore/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,13 @@
which don't represent the actual service api.
"""

import json
import logging
import os
from collections import OrderedDict

from botocore import BOTOCORE_ROOT
from botocore.compat import HAS_GZIP, OrderedDict, json
from botocore.compat import HAS_GZIP
from botocore.exceptions import DataNotFoundError, UnknownServiceError
from botocore.utils import deep_merge

Expand Down
3 changes: 1 addition & 2 deletions botocore/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
# language governing permissions and limitations under the License.
"""Abstractions to interact with service models."""

from collections import defaultdict
from collections import defaultdict, OrderedDict
from typing import NamedTuple, Union

from botocore.auth import resolve_auth_type
from botocore.compat import OrderedDict
from botocore.exceptions import (
MissingServiceIdError,
UndefinedModelAttributeError,
Expand Down
2 changes: 1 addition & 1 deletion botocore/signers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
import datetime
import json
import weakref
from collections import OrderedDict

import botocore
import botocore.auth
from botocore.awsrequest import create_request_object, prepare_request_dict
from botocore.compat import OrderedDict
from botocore.exceptions import (
ParamValidationError,
UnknownClientMethodError,
Expand Down
3 changes: 2 additions & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@
from io import BytesIO
from subprocess import PIPE, Popen
from unittest import mock
from urllib.parse import parse_qs, urlparse

from dateutil.tz import tzlocal

import botocore.loaders
import botocore.session
from botocore import credentials, utils
from botocore.awsrequest import AWSResponse
from botocore.compat import HAS_CRT, parse_qs, urlparse
from botocore.compat import HAS_CRT
from botocore.configprovider import create_botocore_default_config_mapping
from botocore.httpchecksum import _CHECKSUM_CLS, DEFAULT_CHECKSUM_ALGORITHM
from botocore.stub import Stubber
Expand Down
3 changes: 2 additions & 1 deletion tests/functional/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from botocore.compat import json
import json

from botocore.config import Config
from botocore.discovery import EndpointDiscoveryRequired
from botocore.exceptions import (
Expand Down
3 changes: 2 additions & 1 deletion tests/functional/test_dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from botocore.compat import json
import json

from botocore.config import Config
from tests import BaseSessionTest, ClientHTTPStubber

Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import tempfile
import threading
import time
from collections import defaultdict
from collections import defaultdict, OrderedDict
from contextlib import closing
from io import BytesIO
from tarfile import TarFile
Expand All @@ -27,7 +27,7 @@
import botocore.auth
import botocore.credentials
import botocore.session
from botocore.compat import OrderedDict, zip_longest
from botocore.compat import zip_longest
from botocore.config import Config
from botocore.exceptions import ClientError, ConnectionClosedError, WaiterError
from tests import (
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/auth/test_signers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
import io
import json
import time
from urllib.parse import parse_qs, urlsplit

import botocore.auth
import botocore.credentials
from botocore.awsrequest import AWSRequest
from botocore.compat import HTTPHeaders, parse_qs, urlsplit
from botocore.compat import HTTPHeaders
from tests import mock, unittest


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/auth/test_sigv4.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
import os
import re
from http.server import BaseHTTPRequestHandler
from urllib.parse import parse_qsl, urlsplit

import pytest

import botocore.auth
from botocore.awsrequest import AWSRequest
from botocore.compat import parse_qsl, urlsplit
from botocore.credentials import Credentials
from tests import FreezeTime

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/docs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import os
import shutil
import tempfile
from collections import OrderedDict

from botocore.client import ClientCreator
from botocore.compat import OrderedDict
from botocore.configprovider import ConfigValueStore
from botocore.docs.bcdoc.restdoc import DocumentStructure
from botocore.hooks import HierarchicalEmitter
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/docs/test_sharedexample.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from botocore.compat import OrderedDict
from collections import OrderedDict

from botocore.docs.sharedexample import (
SharedExampleDocumenter,
document_shared_examples,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import json
import os
import shutil
import subprocess
Expand All @@ -25,7 +26,6 @@
import botocore.exceptions
import botocore.session
from botocore import credentials
from botocore.compat import json
from botocore.configprovider import ConfigValueStore
from botocore.credentials import (
AssumeRoleProvider,
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
import json
import logging
import os
from collections import OrderedDict
from urllib.parse import quote

import pytest

import botocore
import botocore.session
from botocore import handlers
from botocore.awsrequest import AWSRequest
from botocore.compat import OrderedDict, quote
from botocore.config import Config
from botocore.credentials import Credentials
from botocore.docs.bcdoc.restdoc import DocumentStructure
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from collections import OrderedDict

import pytest

from botocore import model
from botocore.compat import OrderedDict
from tests import unittest


Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
# language governing permissions and limitations under the License.
import datetime
import itertools
import json

import pytest
from dateutil.tz import tzutc

from botocore import model, parsers
from botocore.compat import MutableMapping, json
from botocore.compat import MutableMapping
from tests import RawResponse, unittest


Expand Down
4 changes: 3 additions & 1 deletion tests/unit/test_protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,18 @@
"""

import copy
import json
import os
from base64 import b64decode
from calendar import timegm
from collections import OrderedDict
from enum import Enum
from urllib.parse import urlsplit

import pytest
from dateutil.tz import tzutc

from botocore.awsrequest import HeadersDict, prepare_request_dict
from botocore.compat import OrderedDict, json, urlsplit
from botocore.eventstream import EventStream
from botocore.model import NoShapeFoundError, OperationModel, ServiceModel
from botocore.parsers import (
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_s3_addressing.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
# language governing permissions and limitations under the License.

import os
from collections import OrderedDict

from botocore.compat import OrderedDict
from botocore.handlers import set_list_objects_encoding_type_url
from tests import BaseSessionTest, ClientHTTPStubber

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import copy
import datetime
import io
import json
import operator
from contextlib import contextmanager
from sys import getrefcount
Expand All @@ -23,7 +24,6 @@
import botocore
from botocore import xform_name
from botocore.awsrequest import AWSRequest, HeadersDict
from botocore.compat import json
from botocore.config import Config
from botocore.endpoint_provider import RuleSetEndpoint
from botocore.exceptions import (
Expand Down