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

Use botocore vendoring of six #1057

Merged
merged 2 commits into from
Dec 11, 2014
Merged
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 awscli/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# language governing permissions and limitations under the License.
import argparse
import sys
import six
from awscli.compat import six
from difflib import get_close_matches


Expand Down
2 changes: 1 addition & 1 deletion awscli/argprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""Module for processing CLI args."""
import os
import logging
import six
from awscli.compat import six

from botocore import xform_name
from botocore.compat import OrderedDict, json
Expand Down
14 changes: 13 additions & 1 deletion awscli/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import sys
import six

from botocore.compat import six
#import botocore.compat

# If you ever want to import from the vendored six. Add it here and then
# import from awscli.compat. Also try to keep it in alphabetical order.
# This may get large.
advance_iterator = six.advance_iterator
PY3 = six.PY3
queue = six.moves.queue
shlex_quote = six.moves.shlex_quote
StringIO = six.StringIO
urlopen = six.moves.urllib.request.urlopen

if six.PY3:
import locale
Expand Down
2 changes: 1 addition & 1 deletion awscli/customizations/codedeploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import contextlib
from datetime import datetime

import six
from awscli.compat import six

from awscli.argprocess import unpack_cli_arg
from awscli.arguments import CustomArgument
Expand Down
2 changes: 1 addition & 1 deletion awscli/customizations/ec2bundleinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import base64
import datetime

import six
from awscli.compat import six

from awscli.arguments import CustomArgument

Expand Down
2 changes: 1 addition & 1 deletion awscli/customizations/ec2decryptpassword.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import os
import base64
import rsa
import six
from awscli.compat import six

from botocore import model

Expand Down
3 changes: 1 addition & 2 deletions awscli/customizations/opsworks.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
import sys
import tempfile
import textwrap
from six.moves import shlex_quote
from six.moves.urllib.request import urlopen

from awscli.compat import shlex_quote, urlopen
from awscli.customizations.commands import BasicCommand
from awscli.errorhandler import ClientError

Expand Down
2 changes: 1 addition & 1 deletion awscli/customizations/s3/comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import logging
from six import advance_iterator
from awscli.compat import advance_iterator


LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion awscli/customizations/s3/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import logging
from six.moves import queue
import sys
import threading

from awscli.customizations.s3.utils import uni_print, bytes_print, \
IORequest, IOCloseRequest, StablePriorityQueue
from awscli.customizations.s3.tasks import OrderableTask
from awscli.compat import queue


LOGGER = logging.getLogger(__name__)
Expand Down
5 changes: 2 additions & 3 deletions awscli/customizations/s3/filegenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@
import sys
import stat

import six
from six.moves import queue
from dateutil.parser import parse
from dateutil.tz import tzlocal

from awscli.customizations.s3.utils import find_bucket_key, get_file_stat
from awscli.customizations.s3.utils import BucketLister, create_warning, \
find_dest_path_comp_key
from awscli.errorhandler import ClientError

from awscli.compat import six
from awscli.compat import queue

_open = open

Expand Down
5 changes: 3 additions & 2 deletions awscli/customizations/s3/s3handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import logging
import math
import os
import six
from six.moves import queue
import sys

from awscli.customizations.s3.constants import MULTI_THRESHOLD, CHUNKSIZE, \
Expand All @@ -24,6 +22,9 @@
operate, find_bucket_key, relative_path, PrintTask, create_warning
from awscli.customizations.s3.executor import Executor
from awscli.customizations.s3 import tasks
from awscli.compat import six
from awscli.compat import queue


LOGGER = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions awscli/customizations/s3/subcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import os
import six
from six.moves import queue
import sys

from dateutil.parser import parse
from dateutil.tz import tzlocal

from awscli.compat import six
from awscli.compat import queue
from awscli.customizations.commands import BasicCommand
from awscli.customizations.s3.comparator import Comparator
from awscli.customizations.s3.fileinfobuilder import FileInfoBuilder
Expand Down
5 changes: 3 additions & 2 deletions awscli/customizations/s3/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
from collections import namedtuple, deque
from functools import partial

from six import PY3
from six.moves import queue
from dateutil.parser import parse
from dateutil.tz import tzlocal
from botocore.compat import unquote_str

from awscli.customizations.s3.constants import MAX_PARTS
from awscli.customizations.s3.constants import MAX_SINGLE_UPLOAD_SIZE
from awscli.compat import six
from awscli.compat import PY3
from awscli.compat import queue


class AppendFilter(argparse.Action):
Expand Down
2 changes: 1 addition & 1 deletion awscli/paramfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import os

from botocore.vendored import requests
import six
from awscli.compat import six

from awscli.compat import compat_open

Expand Down
2 changes: 1 addition & 1 deletion awscli/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import struct

import colorama
import six
from awscli.compat import six


def determine_terminal_width(default_width=80):
Expand Down
2 changes: 1 addition & 1 deletion awscli/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
# *uses* this module that isn't suppose to, that's s
# different story.
mock = None
import six
from awscli.compat import six
from botocore.hooks import HierarchicalEmitter
from botocore.session import Session
import botocore.loaders
Expand Down
2 changes: 1 addition & 1 deletion awscli/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,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 six
from awscli.compat import six


def format_text(data, stream):
Expand Down
2 changes: 1 addition & 1 deletion awscli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import csv
import datetime

import six
from awscli.compat import six


def split_on_commas(value):
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
six>=1.8.0,<2.0.0
tox==1.4
docutils>=0.10
Sphinx==1.1.3
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

requires = ['botocore>=0.78.0,<0.79.0',
'bcdoc>=0.12.0,<0.13.0',
'six>=1.8.0,<2.0.0',
'colorama==0.2.5',
'docutils>=0.10',
'rsa==3.1.2']
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/customizations/s3/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import socket

import botocore.session
import six
from awscli.compat import six

from awscli.testutils import unittest, FileCreator, get_stdout_encoding
from awscli.testutils import aws as _aws
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/customizations/s3/test_s3handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import os
import datetime
import random
from six import StringIO
import sys
from awscli.testutils import unittest

from awscli import EnvironmentVariables
from awscli.compat import StringIO
from awscli.customizations.s3.s3handler import S3Handler
from awscli.customizations.s3.fileinfo import FileInfo
import botocore.session
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/customizations/configservice/test_getstatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import mock
import six
from awscli.compat import six

from awscli.testutils import unittest
from awscli.customizations.configservice.getstatus import GetStatusCommand
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/customizations/datapipeline/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import copy
import mock

import six
from awscli.compat import six
from awscli.testutils import BaseAWSHelpOutputTest, BaseAWSCommandParamsTest, \
unittest

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/customizations/s3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from awscli.testutils import unittest
import string

import six
from awscli.compat import six
from mock import patch, Mock


Expand Down
1 change: 1 addition & 0 deletions tests/unit/customizations/s3/fake_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import hashlib
from operator import itemgetter
from botocore.vendored import requests
from awscli.compat import six
from six import text_type
from six import StringIO
from io import BytesIO
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/customizations/s3/test_cp_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import re

import mock
import six
from awscli.compat import six


class TestCPCommand(BaseAWSCommandParamsTest):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/customizations/s3/test_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import os
import tempfile
import shutil
import six
from awscli.compat import six
from six.moves import queue
import sys

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/customizations/s3/test_filegenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import shutil
import socket

import six
from awscli.compat import six
import mock

from awscli.customizations.s3.filegenerator import FileGenerator, \
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/customizations/s3/test_fileinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from datetime import datetime
from hashlib import md5

import six
from awscli.compat import six
import mock

from awscli.testutils import unittest
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/customizations/s3/test_mv_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import re

import mock
import six
from awscli.compat import six


class TestMvCommand(BaseAWSCommandParamsTest):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/customizations/s3/test_subcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# language governing permissions and limitations under the License.
import argparse
import os
from six import StringIO
import sys

import mock
Expand All @@ -28,6 +27,7 @@
from tests.unit.customizations.s3 import make_loc_files, clean_loc_files, \
make_s3_files, s3_cleanup, S3HandlerBaseTest
from tests.unit.customizations.s3.fake_session import FakeSession
from awscli.compat import StringIO


class FakeArgs(object):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/customizations/test_cloudtrail.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import botocore.session
import json
import os
import six
from awscli.compat import six

from awscli.customizations.cloudtrail import CloudTrailSubscribe
from awscli.customizations.service import Service
Expand Down
1 change: 1 addition & 0 deletions tests/unit/customizations/test_codedeploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import argparse

from mock import Mock, ANY, patch, MagicMock
from awscli.compat import six
from six import StringIO

from awscli.customizations.codedeploy import S3Client
Expand Down
1 change: 1 addition & 0 deletions tests/unit/customizations/test_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from awscli.testutils import unittest

import mock
from awscli.compat import six
from six import StringIO
from botocore.exceptions import ProfileNotFound

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/customizations/test_generatecliskeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,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 six
from awscli.compat import six
import mock

from botocore.model import DenormalizedStructureBuilder
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/customizations/test_globalargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from awscli.testutils import unittest
import six
from awscli.compat import six
import mock

from awscli.customizations import globalargs
Expand Down
Loading