[packages/python-boto] - updated to 2.49.0, added apidocs and tests - added mock patch (allow using unittest.mock instead o

qboosh qboosh at pld-linux.org
Sun Feb 14 21:39:07 CET 2021


commit 32c798376e3e1187ba6ec0b3fe28893678e8e452
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Feb 14 21:39:39 2021 +0100

    - updated to 2.49.0, added apidocs and tests
    - added mock patch (allow using unittest.mock instead of separate mock on python3)
    - added py3 patch (fix one library and one test issue with python 3.2+)

 python-boto-mock.patch | 330 +++++++++++++++++++++++++++++++++++++++++++++++++
 python-boto-py3.patch  |  53 ++++++++
 python-boto.spec       | 194 +++++++++++++++++++++++++----
 3 files changed, 555 insertions(+), 22 deletions(-)
---
diff --git a/python-boto.spec b/python-boto.spec
index 1c379db..87438d3 100644
--- a/python-boto.spec
+++ b/python-boto.spec
@@ -1,3 +1,7 @@
+#
+# Conditional build:
+%bcond_without	doc	# Sphinx documentation
+%bcond_without	tests	# unit tests
 %bcond_without	python2 # CPython 2.x module
 %bcond_without	python3 # CPython 3.x module
 
@@ -5,17 +9,37 @@
 Summary:	An integrated interface to infrastructural services offered by Amazon Web Services
 Summary(pl.UTF-8):	Zintegrowany interfejs do usług infrastruktury oferowanych przez usługi WWW Amazon
 Name:		python-%{module}
-Version:	2.42.0
-Release:	4
+Version:	2.49.0
+Release:	1
 License:	MIT
 Group:		Libraries/Python
-Source0:	https://pypi.python.org/packages/c4/bb/28324652bedb4ea9ca77253b84567d1347b54df6231b51822eaaa296e6e0/boto-%{version}.tar.gz
-# Source0-md5:	62b6ef1af3d18f8811f97e311b856dad
+#Source0Download: https://pypi.org/simple/boto/
+Source0:	https://files.pythonhosted.org/packages/source/b/boto/boto-%{version}.tar.gz
+# Source0-md5:	e9b79f80198da059d9a8055a5352fd6d
+Patch0:		%{name}-mock.patch
+Patch1:		%{name}-py3.patch
 URL:		https://github.com/boto/boto
-BuildRequires:	python-devel
+%if %{with python2}
+BuildRequires:	python-modules >= 1:2.6
+BuildRequires:	python-setuptools
+%if %{with tests}
+BuildRequires:	python-mock
+BuildRequires:	python-nose
+%endif
+%endif
+%if %{with python3}
+BuildRequires:	python3-modules >= 1:3.3
+BuildRequires:	python3-setuptools
+%if %{with tests}
+BuildRequires:	python3-nose
+%endif
+%endif
 BuildRequires:	rpm-pythonprov
-BuildRequires:	rpmbuild(macros) >= 1.710
-Requires:	python-libs
+BuildRequires:	rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires:	sphinx-pdg-2
+%endif
+Requires:	python-modules >= 1:2.6
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -31,6 +55,7 @@ oferowanych przez usługi WWW Amazon.
 Summary:	An integrated interface to infrastructural services offered by Amazon Web Services
 Summary(pl.UTF-8):	Zintegrowany interfejs do usług infrastruktury oferowanych przez usługi WWW Amazon
 Group:		Libraries/Python
+Requires:	python3-modules >= 1:3.3
 
 %description -n python3-%{module}
 An integrated interface to current and future infrastructural services
@@ -42,8 +67,13 @@ oferowanych przez usługi WWW Amazon.
 
 %package -n boto
 Summary:	Python utilities for Amazon Web Services
-Group:		Applications
+Summary(pl.UTF-8):	Pythonowe narzędzia do usług AWS
+Group:		Applications/Networking
+%if %{with python3}
+Requires:	python3-%{module} = %{version}-%{release}
+%else
 Requires:	%{name} = %{version}-%{release}
+%endif
 
 %description -n boto
 Boto is an integrated Python interface to current and future
@@ -51,49 +81,169 @@ infrastructural services offered by Amazon Web Services.
 
 This package includes sample utilities implemented with this API.
 
+%description -n boto -l pl.UTF-8
+Boto to zintegrowany interfejs do aktualnych i przyszłych usług
+infrastruktury oferowanych przez usługi AWS (Amazon WWW Services).
+
+Ten pakiet zawiera przykładowe narzędzia zaimplementowane przy użyciu
+API boto.
+
+%package apidocs
+Summary:	API documentation for Python boto module
+Summary(pl.UTF-8):	Dokumentacja API modułu Pythona boto
+Group:		Documentation
+
+%description apidocs
+API documentation for Python boto module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona boto.
+
 %prep
 %setup -q -n %{module}-%{version}
+%patch0 -p1
+%patch1 -p1
 
 %build
 %if %{with python3}
-%py3_build %{?with_tests:test}
+%py3_build
+
+%if %{with tests}
+nosetests-%{py_ver} tests/unit -a '!notdefault'
+%endif
 %endif
 
 %if %{with python2}
-%py_build %{?with_tests:test}
+%py_build
+
+%if %{with tests}
+nosetests-%{py3_ver} tests/unit -a '!notdefault'
+%endif
+%endif
+
+%if %{with doc}
+# docs are not ready for python3
+PYTHONPATH=$(pwd) \
+%{__make} -C docs html \
+	SPHINXBUILD=sphinx-build-2
 %endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%if %{with python3}
-%py3_install
-rm -rf $RPM_BUILD_ROOT%{py3_sitescriptdir}/tests
-%endif
-
 %if %{with python2}
-rm -rf $RPM_BUILD_ROOT%{_bindir}
 %py_install
 
-rm -rf $RPM_BUILD_ROOT%{py_sitescriptdir}/tests
+for bin in asadmin bundle_image cfadmin cq cwutil dynamodb_dump dynamodb_load elbadmin \
+	   fetch_file glacier instance_events kill_instance launch_instance list_instances \
+	   lss3 mturk pyami_sendmail route53 s3put sdbadmin taskadmin ; do
+	%{__mv} $RPM_BUILD_ROOT%{_bindir}/${bin} $RPM_BUILD_ROOT%{_bindir}/${bin}-2
+%if %{without python3}
+	ln -sf ${bin}-2 $RPM_BUILD_ROOT%{_bindir}/${bin}
+%endif
+done
+
 %py_postclean
 %endif
 
+%if %{with python3}
+%py3_install
+
+for bin in asadmin bundle_image cfadmin cq cwutil dynamodb_dump dynamodb_load elbadmin \
+	   fetch_file glacier instance_events kill_instance launch_instance list_instances \
+	   lss3 mturk pyami_sendmail route53 s3put sdbadmin taskadmin ; do
+	%{__mv} $RPM_BUILD_ROOT%{_bindir}/${bin} $RPM_BUILD_ROOT%{_bindir}/${bin}-3
+	ln -sf ${bin}-3 $RPM_BUILD_ROOT%{_bindir}/${bin}
+done
+%endif
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %files
 %defattr(644,root,root,755)
-%doc PKG-INFO README*
+%doc README.rst
+%attr(755,root,root) %{_bindir}/asadmin-2
+%attr(755,root,root) %{_bindir}/bundle_image-2
+%attr(755,root,root) %{_bindir}/cfadmin-2
+%attr(755,root,root) %{_bindir}/cq-2
+%attr(755,root,root) %{_bindir}/cwutil-2
+%attr(755,root,root) %{_bindir}/dynamodb_dump-2
+%attr(755,root,root) %{_bindir}/dynamodb_load-2
+%attr(755,root,root) %{_bindir}/elbadmin-2
+%attr(755,root,root) %{_bindir}/fetch_file-2
+%attr(755,root,root) %{_bindir}/glacier-2
+%attr(755,root,root) %{_bindir}/instance_events-2
+%attr(755,root,root) %{_bindir}/kill_instance-2
+%attr(755,root,root) %{_bindir}/launch_instance-2
+%attr(755,root,root) %{_bindir}/list_instances-2
+%attr(755,root,root) %{_bindir}/lss3-2
+%attr(755,root,root) %{_bindir}/mturk-2
+%attr(755,root,root) %{_bindir}/pyami_sendmail-2
+%attr(755,root,root) %{_bindir}/route53-2
+%attr(755,root,root) %{_bindir}/s3put-2
+%attr(755,root,root) %{_bindir}/sdbadmin-2
+%attr(755,root,root) %{_bindir}/taskadmin-2
 %{py_sitescriptdir}/boto
-%{py_sitescriptdir}/boto-*.egg-info
+%{py_sitescriptdir}/boto-%{version}-py*.egg-info
+%endif
 
+%if %{with python3}
 %files -n python3-%{module}
 %defattr(644,root,root,755)
-%doc PKG-INFO README*
+%doc README.rst
+%attr(755,root,root) %{_bindir}/asadmin-3
+%attr(755,root,root) %{_bindir}/bundle_image-3
+%attr(755,root,root) %{_bindir}/cfadmin-3
+%attr(755,root,root) %{_bindir}/cq-3
+%attr(755,root,root) %{_bindir}/cwutil-3
+%attr(755,root,root) %{_bindir}/dynamodb_dump-3
+%attr(755,root,root) %{_bindir}/dynamodb_load-3
+%attr(755,root,root) %{_bindir}/elbadmin-3
+%attr(755,root,root) %{_bindir}/fetch_file-3
+%attr(755,root,root) %{_bindir}/glacier-3
+%attr(755,root,root) %{_bindir}/instance_events-3
+%attr(755,root,root) %{_bindir}/kill_instance-3
+%attr(755,root,root) %{_bindir}/launch_instance-3
+%attr(755,root,root) %{_bindir}/list_instances-3
+%attr(755,root,root) %{_bindir}/lss3-3
+%attr(755,root,root) %{_bindir}/mturk-3
+%attr(755,root,root) %{_bindir}/pyami_sendmail-3
+%attr(755,root,root) %{_bindir}/route53-3
+%attr(755,root,root) %{_bindir}/s3put-3
+%attr(755,root,root) %{_bindir}/sdbadmin-3
+%attr(755,root,root) %{_bindir}/taskadmin-3
 %{py3_sitescriptdir}/boto
-%{py3_sitescriptdir}/boto-*.egg-info
+%{py3_sitescriptdir}/boto-%{version}-py*.egg-info
+%endif
 
 %files -n boto
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/*
+%attr(755,root,root) %{_bindir}/asadmin
+%attr(755,root,root) %{_bindir}/bundle_image
+%attr(755,root,root) %{_bindir}/cfadmin
+%attr(755,root,root) %{_bindir}/cq
+%attr(755,root,root) %{_bindir}/cwutil
+%attr(755,root,root) %{_bindir}/dynamodb_dump
+%attr(755,root,root) %{_bindir}/dynamodb_load
+%attr(755,root,root) %{_bindir}/elbadmin
+%attr(755,root,root) %{_bindir}/fetch_file
+%attr(755,root,root) %{_bindir}/glacier
+%attr(755,root,root) %{_bindir}/instance_events
+%attr(755,root,root) %{_bindir}/kill_instance
+%attr(755,root,root) %{_bindir}/launch_instance
+%attr(755,root,root) %{_bindir}/list_instances
+%attr(755,root,root) %{_bindir}/lss3
+%attr(755,root,root) %{_bindir}/mturk
+%attr(755,root,root) %{_bindir}/pyami_sendmail
+%attr(755,root,root) %{_bindir}/route53
+%attr(755,root,root) %{_bindir}/s3put
+%attr(755,root,root) %{_bindir}/sdbadmin
+%attr(755,root,root) %{_bindir}/taskadmin
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/build/html/{_static,migrations,ref,releasenotes,*.html,*.js}
+%endif
diff --git a/python-boto-mock.patch b/python-boto-mock.patch
new file mode 100644
index 0000000..65f1d34
--- /dev/null
+++ b/python-boto-mock.patch
@@ -0,0 +1,330 @@
+--- boto-2.49.0/tests/integration/s3/test_bucket.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/integration/s3/test_bucket.py	2021-02-14 20:03:03.481843289 +0100
+@@ -26,7 +26,10 @@
+ Some unit tests for the S3 Bucket
+ """
+ 
+-from mock import patch, Mock
++try:
++    from mock import patch, Mock
++except ImportError:
++    from unittest.mock import patch, Mock
+ import unittest
+ import time
+ 
+--- boto-2.49.0/tests/integration/s3/test_https_cert_validation.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/integration/s3/test_https_cert_validation.py	2021-02-14 20:03:18.711760781 +0100
+@@ -38,7 +38,7 @@ Note that this test assumes two external
+ import os
+ import ssl
+ import unittest
+-import mock
++from tests.compat import mock
+ 
+ from nose.plugins.attrib import attr
+ 
+--- boto-2.49.0/tests/integration/s3/test_multipart.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/integration/s3/test_multipart.py	2021-02-14 20:03:12.025130339 +0100
+@@ -37,7 +37,7 @@ import unittest
+ import time
+ from boto.compat import StringIO
+ 
+-import mock
++from tests.compat import mock
+ 
+ import boto
+ from boto.s3.connection import S3Connection
+--- boto-2.49.0/tests/unit/auth/test_stsanon.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/auth/test_stsanon.py	2021-02-14 19:57:30.110315984 +0100
+@@ -20,7 +20,10 @@
+ # IN THE SOFTWARE.
+ #
+ import copy
+-from mock import Mock
++try:
++    from mock import Mock
++except ImportError:
++    from unittest.mock import Mock
+ from tests.unit import unittest
+ 
+ from boto.auth import STSAnonHandler
+--- boto-2.49.0/tests/unit/cloudformation/test_connection.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/cloudformation/test_connection.py	2021-02-14 20:01:15.389095544 +0100
+@@ -1,7 +1,10 @@
+ #!/usr/bin/env python
+ import unittest
+ from datetime import datetime
+-from mock import Mock
++try:
++    from mock import Mock
++except ImportError:
++    from unittest.mock import Mock
+ 
+ from tests.unit import AWSMockServiceTestCase
+ from boto.cloudformation.connection import CloudFormationConnection
+--- boto-2.49.0/tests/unit/cloudsearch2/test_document.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/cloudsearch2/test_document.py	2021-02-14 20:00:05.506140799 +0100
+@@ -4,7 +4,10 @@ from boto.cloudsearch2.layer1 import Clo
+ 
+ from tests.unit import unittest, AWSMockServiceTestCase
+ from httpretty import HTTPretty
+-from mock import MagicMock
++try:
++    from mock import MagicMock
++except ImportError:
++    from unittest.mock import MagicMock
+ 
+ import json
+ 
+--- boto-2.49.0/tests/unit/cloudsearchdomain/test_cloudsearchdomain.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/cloudsearchdomain/test_cloudsearchdomain.py	2021-02-14 19:59:29.589668709 +0100
+@@ -1,6 +1,6 @@
+ #!/usr/bin env python
+ import json
+-import mock
++from tests.compat import mock
+ from tests.unit import AWSMockServiceTestCase
+ from boto.cloudsearch2.domain import Domain
+ from boto.cloudsearch2.layer1 import CloudSearchConnection
+--- boto-2.49.0/tests/unit/cloudsearch/test_document.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/cloudsearch/test_document.py	2021-02-14 20:00:44.145931469 +0100
+@@ -2,7 +2,10 @@
+ 
+ from tests.unit import unittest
+ from httpretty import HTTPretty
+-from mock import MagicMock
++try:
++    from mock import MagicMock
++except ImportError:
++    from unittest.mock import MagicMock
+ 
+ import json
+ 
+--- boto-2.49.0/tests/unit/dynamodb/test_layer2.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/dynamodb/test_layer2.py	2021-02-14 20:00:25.679364845 +0100
+@@ -22,7 +22,10 @@
+ #
+ 
+ from tests.unit import unittest
+-from mock import Mock
++try:
++    from mock import Mock
++except ImportError:
++    from unittest.mock import Mock
+ 
+ from boto.dynamodb.layer2 import Layer2
+ from boto.dynamodb.table import Table, Schema
+--- boto-2.49.0/tests/unit/ec2containerservice/test_connection.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/ec2containerservice/test_connection.py	2021-02-14 19:55:05.694431685 +0100
+@@ -20,7 +20,10 @@
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ # IN THE SOFTWARE.
+ #
+-from mock import Mock
++try:
++    from mock import Mock
++except ImportError:
++    from unittest.mock import Mock
+ from tests.unit import unittest
+ 
+ import boto.ec2containerservice
+--- boto-2.49.0/tests/unit/ec2/test_connection.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/ec2/test_connection.py	2021-02-14 20:02:23.685392218 +0100
+@@ -1,6 +1,9 @@
+ #!/usr/bin/env python
+ from datetime import datetime, timedelta
+-from mock import MagicMock, Mock
++try:
++    from mock import MagicMock, Mock
++except ImportError:
++    from unittest.mock import MagicMock, Mock
+ from tests.unit import unittest
+ from tests.unit import AWSMockServiceTestCase
+ 
+--- boto-2.49.0/tests/unit/glacier/test_layer2.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/glacier/test_layer2.py	2021-02-14 19:58:41.029931779 +0100
+@@ -23,7 +23,10 @@
+ 
+ from tests.unit import unittest
+ 
+-from mock import call, Mock, patch, sentinel
++try:
++    from mock import call, Mock, patch, sentinel
++except ImportError:
++    from unittest.mock import call, Mock, patch, sentinel
+ 
+ import codecs
+ from boto.glacier.layer1 import Layer1
+--- boto-2.49.0/tests/unit/glacier/test_writer.py.orig	2018-07-11 22:41:30.000000000 +0200
++++ boto-2.49.0/tests/unit/glacier/test_writer.py	2021-02-14 19:59:16.493072992 +0100
+@@ -24,11 +24,19 @@ import itertools
+ from boto.compat import StringIO
+ 
+ from tests.unit import unittest
+-from mock import (
+-    call,
+-    Mock,
+-    sentinel,
+-)
++try:
++    from mock import (
++        call,
++        Mock,
++        sentinel,
++    )
++except ImportError:
++    from unittest.mock import (
++        call,
++        Mock,
++        sentinel,
++    )
++
+ from nose.tools import assert_equal
+ 
+ from boto.glacier.layer1 import Layer1
+--- boto-2.49.0/tests/unit/mws/test_connection.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/mws/test_connection.py	2021-02-14 19:57:56.120175076 +0100
+@@ -29,7 +29,10 @@ from tests.compat import unittest
+ 
+ from tests.unit import AWSMockServiceTestCase
+ 
+-from mock import MagicMock
++try:
++    from mock import MagicMock
++except ImportError:
++    from unittest.mock import MagicMock
+ 
+ 
+ class TestMWSConnection(AWSMockServiceTestCase):
+--- boto-2.49.0/tests/unit/s3/test_bucketlistresultset.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/s3/test_bucketlistresultset.py	2021-02-14 19:56:36.633939023 +0100
+@@ -22,7 +22,10 @@
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ # IN THE SOFTWARE.
+ 
+-from mock import patch, Mock
++try:
++    from mock import patch, Mock
++except ImportError:
++    from unittest.mock import patch, Mock
+ import unittest
+ 
+ from boto.s3.bucket import ResultSet
+--- boto-2.49.0/tests/unit/s3/test_bucket.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/s3/test_bucket.py	2021-02-14 19:56:54.867173579 +0100
+@@ -1,5 +1,8 @@
+ # -*- coding: utf-8 -*-
+-from mock import patch
++try:
++    from mock import patch
++except ImportError:
++    from unittest.mock import patch
+ import xml.dom.minidom
+ 
+ from tests.unit import unittest
+--- boto-2.49.0/tests/unit/sns/test_connection.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/sns/test_connection.py	2021-02-14 19:57:21.567028933 +0100
+@@ -23,7 +23,10 @@
+ import json
+ from tests.unit import unittest
+ from tests.unit import AWSMockServiceTestCase
+-from mock import Mock
++try:
++    from mock import Mock
++except ImportError:
++    from unittest.mock import Mock
+ 
+ from boto.sns.connection import SNSConnection
+ 
+--- boto-2.49.0/tests/unit/sqs/test_queue.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/sqs/test_queue.py	2021-02-14 20:00:55.939200913 +0100
+@@ -20,7 +20,10 @@
+ # IN THE SOFTWARE.
+ #
+ from tests.unit import unittest
+-from mock import Mock
++try:
++    from mock import Mock
++except ImportError:
++    from unittest.mock import Mock
+ 
+ from boto.sqs.queue import Queue
+ 
+--- boto-2.49.0/tests/unit/swf/test_layer2_actors.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/swf/test_layer2_actors.py	2021-02-14 20:01:29.175687522 +0100
+@@ -1,7 +1,10 @@
+ import boto.swf.layer2
+ from boto.swf.layer2 import Decider, ActivityWorker
+ from tests.unit import unittest
+-from mock import Mock
++try:
++    from mock import Mock
++except ImportError:
++    from unittest.mock import Mock
+ 
+ 
+ class TestActors(unittest.TestCase):
+--- boto-2.49.0/tests/unit/swf/test_layer2_base.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/swf/test_layer2_base.py	2021-02-14 20:01:23.549051338 +0100
+@@ -1,7 +1,10 @@
+ import boto.swf.layer2
+ from boto.swf.layer2 import SWFBase
+ from tests.unit import unittest
+-from mock import Mock
++try:
++    from mock import Mock
++except ImportError:
++    from unittest.mock import Mock
+ 
+ 
+ MOCK_DOMAIN = 'Mock'
+--- boto-2.49.0/tests/unit/swf/test_layer2_domain.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/swf/test_layer2_domain.py	2021-02-14 20:01:54.462217200 +0100
+@@ -1,7 +1,10 @@
+ import boto.swf.layer2
+ from boto.swf.layer2 import Domain, ActivityType, WorkflowType, WorkflowExecution
+ from tests.unit import unittest
+-from mock import Mock
++try:
++    from mock import Mock
++except ImportError:
++    from unittest.mock import Mock
+ 
+ 
+ class TestDomain(unittest.TestCase):
+--- boto-2.49.0/tests/unit/swf/test_layer2_types.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/swf/test_layer2_types.py	2021-02-14 20:01:44.152273054 +0100
+@@ -1,7 +1,10 @@
+ import boto.swf.layer2
+ from boto.swf.layer2 import ActivityType, WorkflowType, WorkflowExecution
+ from tests.unit import unittest
+-from mock import Mock, ANY
++try:
++    from mock import Mock, ANY
++except ImportError:
++    from unittest.mock import Mock, ANY
+ 
+ 
+ class TestTypes(unittest.TestCase):
+--- boto-2.49.0/tests/unit/test_endpoints.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/test_endpoints.py	2021-02-14 19:58:14.186743868 +0100
+@@ -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 mock
++from tests.compat import mock
+ import os
+ import json
+ 
+--- boto-2.49.0/tests/unit/test_regioninfo.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/test_regioninfo.py	2021-02-14 19:59:40.419610038 +0100
+@@ -20,7 +20,7 @@
+ # IN THE SOFTWARE.
+ #
+ import os
+-import mock
++from tests.compat import mock
+ 
+ import boto
+ from boto.pyami.config import Config
diff --git a/python-boto-py3.patch b/python-boto-py3.patch
new file mode 100644
index 0000000..f8cb36a
--- /dev/null
+++ b/python-boto-py3.patch
@@ -0,0 +1,53 @@
+--- boto-2.49.0/tests/unit/utils/test_utils.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/tests/unit/utils/test_utils.py	2021-02-14 20:42:11.365790376 +0100
+@@ -85,7 +85,7 @@
+         def hmac_hashfunc(cls, msg):
+             if not isinstance(msg, bytes):
+                 msg = msg.encode('utf-8')
+-            return hmac.new(b'mysecretkey', msg)
++            return hmac.new(b'mysecretkey', msg, digestmod=hashlib.md5)
+ 
+         class HMACPassword(Password):
+             hashfunc = hmac_hashfunc
+@@ -95,15 +95,15 @@
+         password.set('foo')
+ 
+         self.assertEquals(str(password),
+-                          hmac.new(b'mysecretkey', b'foo').hexdigest())
++                          hmac.new(b'mysecretkey', b'foo', digestmod=hashlib.md5).hexdigest())
+ 
+     def test_constructor(self):
+-        hmac_hashfunc = lambda msg: hmac.new(b'mysecretkey', msg)
++        hmac_hashfunc = lambda msg: hmac.new(b'mysecretkey', msg, digestmod=hashlib.md5)
+ 
+         password = Password(hashfunc=hmac_hashfunc)
+         password.set('foo')
+         self.assertEquals(password.str,
+-                          hmac.new(b'mysecretkey', b'foo').hexdigest())
++                          hmac.new(b'mysecretkey', b'foo', digestmod=hashlib.md5).hexdigest())
+ 
+ 
+ class TestPythonizeName(unittest.TestCase):
+--- boto-2.49.0/boto/ecs/item.py.orig	2018-07-11 19:35:36.000000000 +0200
++++ boto-2.49.0/boto/ecs/item.py	2021-02-14 20:51:06.116226718 +0100
+@@ -21,7 +21,10 @@
+ 
+ 
+ import xml.sax
+-import cgi
++try:
++    from cgi import escape
++except ImportError:
++    from html import escape
+ from boto.compat import six, StringIO
+ 
+ class ResponseGroup(xml.sax.ContentHandler):
+@@ -67,7 +70,7 @@
+         return None
+ 
+     def endElement(self, name, value, connection):
+-        self._xml.write("%s</%s>" % (cgi.escape(value).replace("&amp;", "&"), name))
++        self._xml.write("%s</%s>" % (escape(value).replace("&amp;", "&"), name))
+         if len(self._nodepath) == 0:
+             return
+         obj = None
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-boto.git/commitdiff/32c798376e3e1187ba6ec0b3fe28893678e8e452



More information about the pld-cvs-commit mailing list