From ca6ec4478def23d567a1aa90b101cd06ca0854e4 Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Mon, 29 Feb 2016 17:09:54 -0500 Subject: [PATCH 1/4] try out unpinning boto. --- moto/__init__.py | 7 +++++++ requirements-dev.txt | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/moto/__init__.py b/moto/__init__.py index df283fc63..be06a8960 100644 --- a/moto/__init__.py +++ b/moto/__init__.py @@ -5,6 +5,7 @@ logging.getLogger('boto').setLevel(logging.CRITICAL) __title__ = 'moto' __version__ = '0.4.22' +from .apigateway import mock_apigateway # flake8: noqa from .autoscaling import mock_autoscaling # flake8: noqa from .awslambda import mock_lambda # flake8: noqa from .cloudformation import mock_cloudformation # flake8: noqa @@ -31,3 +32,9 @@ from .sqs import mock_sqs # flake8: noqa from .sts import mock_sts # flake8: noqa from .route53 import mock_route53 # flake8: noqa from .swf import mock_swf # flake8: noqa + + +# Need to monkey-patch botocore requests back to underlying urllib3 classes +from botocore.awsrequest import HTTPSConnectionPool, HTTPConnectionPool, HTTPConnection, VerifiedHTTPSConnection +HTTPSConnectionPool.ConnectionCls = VerifiedHTTPSConnection +HTTPConnectionPool.ConnectionCls = HTTPConnection diff --git a/requirements-dev.txt b/requirements-dev.txt index a75fdcfb5..7bc506369 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,6 +7,6 @@ freezegun flask # botocore 1.3.29 breaks s3 in tests (lambda and s3 tests) # so we need to pin a boto3 and botocore revision pair that we know works -boto3==1.2.4 -botocore==1.3.28 +boto3#==1.2.4 +botocore#==1.3.28 six From 2e27e9edfbca7a0a26475d8ab9044b05bd4330ba Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Mon, 29 Feb 2016 17:11:32 -0500 Subject: [PATCH 2/4] remove apigateway --- moto/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/moto/__init__.py b/moto/__init__.py index be06a8960..fcf06248f 100644 --- a/moto/__init__.py +++ b/moto/__init__.py @@ -5,7 +5,6 @@ logging.getLogger('boto').setLevel(logging.CRITICAL) __title__ = 'moto' __version__ = '0.4.22' -from .apigateway import mock_apigateway # flake8: noqa from .autoscaling import mock_autoscaling # flake8: noqa from .awslambda import mock_lambda # flake8: noqa from .cloudformation import mock_cloudformation # flake8: noqa From 75a40e45710a9ebadfd78e1892789042ba1969d4 Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Wed, 2 Mar 2016 15:20:35 -0500 Subject: [PATCH 3/4] Wrap botocore patching in tyr/except since we do not require it to be installed. --- moto/__init__.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/moto/__init__.py b/moto/__init__.py index fcf06248f..f1ae2ab66 100644 --- a/moto/__init__.py +++ b/moto/__init__.py @@ -33,7 +33,11 @@ from .route53 import mock_route53 # flake8: noqa from .swf import mock_swf # flake8: noqa -# Need to monkey-patch botocore requests back to underlying urllib3 classes -from botocore.awsrequest import HTTPSConnectionPool, HTTPConnectionPool, HTTPConnection, VerifiedHTTPSConnection -HTTPSConnectionPool.ConnectionCls = VerifiedHTTPSConnection -HTTPConnectionPool.ConnectionCls = HTTPConnection +try: + # Need to monkey-patch botocore requests back to underlying urllib3 classes + from botocore.awsrequest import HTTPSConnectionPool, HTTPConnectionPool, HTTPConnection, VerifiedHTTPSConnection +except ImportError: + pass +else: + HTTPSConnectionPool.ConnectionCls = VerifiedHTTPSConnection + HTTPConnectionPool.ConnectionCls = HTTPConnection From 6b0f92c230702eadd097b99e5c0f2fc91e61e375 Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Wed, 2 Mar 2016 15:20:58 -0500 Subject: [PATCH 4/4] unpin dev requirements. --- requirements-dev.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 7bc506369..f2d5c6cfc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,6 +7,6 @@ freezegun flask # botocore 1.3.29 breaks s3 in tests (lambda and s3 tests) # so we need to pin a boto3 and botocore revision pair that we know works -boto3#==1.2.4 -botocore#==1.3.28 +boto3 +botocore six