Clean up spec file

f38
Garrett Holmstrom 9 years ago
parent 8ea617a00f
commit 3a12803124

@ -1,46 +0,0 @@
commit c5047b3dc1800dda7a6a02766c9bafdaa139014e
Author: Garrett Holmstrom <gholms@devzero.com>
Date: Fri Jan 29 16:37:13 2016 -0800
Decode request bodies before passing them to json
AWSAuthConnection._mexe encodes request bodies as UTF-8, mutating the
original request object in the process. This breaks kinesis's unit
tests on at least python 3.4 and 3.5 on Fedora, because those unit tests
call json.loads, which expect str objects rather than the bytes objects
that _mexe converted it to.
This commit makes the test cases decode request bodies before feeding
them to json.loads.
Index: boto-2.39.0/tests/unit/kinesis/test_kinesis.py
===================================================================
--- boto-2.39.0.orig/tests/unit/kinesis/test_kinesis.py
+++ boto-2.39.0/tests/unit/kinesis/test_kinesis.py
@@ -36,7 +36,7 @@ class TestKinesis(AWSMockServiceTestCase
self.service_connection.put_record('stream-name',
b'\x00\x01\x02\x03\x04\x05', 'partition-key')
- body = json.loads(self.actual_request.body)
+ body = json.loads(self.actual_request.body.decode('utf-8'))
self.assertEqual(body['Data'], 'AAECAwQF')
target = self.actual_request.headers['X-Amz-Target']
@@ -47,7 +47,7 @@ class TestKinesis(AWSMockServiceTestCase
self.service_connection.put_record('stream-name',
'data', 'partition-key')
- body = json.loads(self.actual_request.body)
+ body = json.loads(self.actual_request.body.decode('utf-8'))
self.assertEqual(body['Data'], 'ZGF0YQ==')
target = self.actual_request.headers['X-Amz-Target']
@@ -66,7 +66,7 @@ class TestKinesis(AWSMockServiceTestCase
self.service_connection.put_records(stream_name='stream-name',
records=[record_binary, record_str])
- body = json.loads(self.actual_request.body)
+ body = json.loads(self.actual_request.body.decode('utf-8'))
self.assertEqual(body['Records'][0]['Data'], 'AAECAwQF')
self.assertEqual(body['Records'][1]['Data'], 'ZGF0YQ==')

@ -4,10 +4,11 @@
%bcond_with python3 %bcond_with python3
%endif %endif
%if 0%{?fedora} || 0%{?rhel} > 6 # Unit tests don't work on python 2.6
%bcond_without unittests %if 0%{?el6}
%else
%bcond_with unittests %bcond_with unittests
%else
%bcond_without unittests
%endif %endif
# Boto's sample executables became doc files in F23 # Boto's sample executables became doc files in F23
@ -18,17 +19,10 @@
%endif %endif
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%if %{with python3}
%{!?__python3: %global __python3 /usr/bin/python3}
%{!?python3_sitelib: %global python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%endif # with python3
Summary: A simple, lightweight interface to Amazon Web Services Summary: A simple, lightweight interface to Amazon Web Services
Name: python-boto Name: python-boto
Version: 2.40.0 Version: 2.40.0
Release: 1%{?dist} Release: 2%{?dist}
License: MIT License: MIT
Group: Development/Languages Group: Development/Languages
URL: https://github.com/boto/boto URL: https://github.com/boto/boto
@ -39,9 +33,6 @@ Source1: boto-mit-license.txt
# Unbundle python-six # Unbundle python-six
# https://github.com/boto/boto/pull/3086 # https://github.com/boto/boto/pull/3086
Patch1: boto-2.39.0-devendor.patch Patch1: boto-2.39.0-devendor.patch
# Fix kinesis tests on python 3
# https://github.com/boto/boto/pull/3483
#Patch2: boto-2.39.0-kinesis-decode.patch
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: python-setuptools BuildRequires: python-setuptools
@ -122,15 +113,12 @@ cloud systems like Eucalyptus, OpenStack and Open Nebula.
%prep %prep
%setup -q -n boto-%{version} %setup -q -n boto-%{version}
%patch1 -p1 %patch1 -p1
#%%patch2 -p1
rm -r boto/vendored rm -r boto/vendored
cp -p %{SOURCE1} . cp -p %{SOURCE1} .
#rm -r boto.egg-info
%build %build
%{__python2} setup.py build %{__python2} setup.py build
@ -184,6 +172,9 @@ mv $RPM_BUILD_ROOT/%{_bindir} examples
%changelog %changelog
* Tue Jun 21 2016 Garrett Holmstrom <gholms@fedoraproject.org> - 2.40.0-2
- Cleaned up spec file
* Mon May 23 2016 Jon Ciesla <limburgher@gmail.com> - 2.40.0-1 * Mon May 23 2016 Jon Ciesla <limburgher@gmail.com> - 2.40.0-1
- 2.40.0. - 2.40.0.
- Kinesis patch upstreamed. - Kinesis patch upstreamed.

Loading…
Cancel
Save