diff --git a/python-msgpack-0.4.4-pytest23.patch b/python-msgpack-0.4.4-pytest23.patch new file mode 100644 index 0000000..cae2b81 --- /dev/null +++ b/python-msgpack-0.4.4-pytest23.patch @@ -0,0 +1,29 @@ +From f40fdf523a545035d3f6ee36a31d50993feac14b Mon Sep 17 00:00:00 2001 +From: Ken Dreyer +Date: Fri, 23 Jan 2015 12:22:28 -0700 +Subject: [PATCH] tests: add pytest 2.3 compatibility + +Adjust the skipif conditional to use the older pytest 2.3 syntax. + +(This allows the tests to pass with the system pytest package on RHEL +7.0, since RHEL 7.0 ships pytest 2.3.5.) +--- + test/test_unpack.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/test_unpack.py b/test/test_unpack.py +index 8d0d949..c0d711c 100644 +--- a/test/test_unpack.py ++++ b/test/test_unpack.py +@@ -16,7 +16,7 @@ def test_unpack_array_header_from_file(): + unpacker.unpack() + + +-@mark.skipif(not hasattr(sys, 'getrefcount'), ++@mark.skipif("not hasattr(sys, 'getrefcount') == True", + reason='sys.getrefcount() is needed to pass this test') + def test_unpacker_hook_refcnt(): + result = [] +-- +1.9.3 + diff --git a/python-msgpack.spec b/python-msgpack.spec index 91ce214..a45e974 100644 --- a/python-msgpack.spec +++ b/python-msgpack.spec @@ -4,14 +4,23 @@ %global with_python3 1 %endif +%if 0%{?rhel} && 0%{?rhel} <= 6 +%{!?__python2: %global __python2 /usr/bin/python2} +%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} +%endif + Name: python-%{srcname} Version: 0.4.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Python MessagePack (de)serializer License: ASL 2.0 URL: http://pypi.python.org/pypi/msgpack-python/ Source0: http://pypi.python.org/packages/source/m/%{srcname}-python/%{srcname}-python-%{version}.tar.gz +# Patch for older pytest on EL6 and EL7 +# https://github.com/msgpack/msgpack-python/pull/123 +Patch0: python-msgpack-0.4.4-pytest23.patch BuildRequires: python2-devel BuildRequires: python-setuptools @@ -47,6 +56,10 @@ This is a Python (de)serializer for MessagePack. %prep %setup -q -n %{srcname}-python-%{version} +# Patch for older pytest on EL6 and EL7 +# https://github.com/msgpack/msgpack-python/pull/123 +%patch0 -p1 + %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} @@ -98,6 +111,10 @@ popd %endif %changelog +* Fri Jan 23 2015 Ken Dreyer - 0.4.4-2 +- Patch test suite for EL6 and EL7 compatibility (RHBZ #1182808) +- Add python2 macros for EL6 compatibility (RHBZ #1182808) + * Thu Jan 15 2015 Ken Dreyer - 0.4.4-1 - Update to latest upstream version 0.4.4 (RHBZ #1180507) - Add tests in %%check