diff --git a/python-anykeystore-use-unittest1.patch b/python-anykeystore-use-unittest1.patch new file mode 100644 index 0000000..0276bdb --- /dev/null +++ b/python-anykeystore-use-unittest1.patch @@ -0,0 +1,107 @@ +From 2cacf170d2b023138054c4fe4a7700e980c598c2 Mon Sep 17 00:00:00 2001 +From: Ralph Bean +Date: Thu, 12 Jun 2014 09:14:07 -0400 +Subject: [PATCH] Just use unittest1. + +--- + anykeystore/tests/integration/tests.py | 2 +- + anykeystore/tests/test_backends/test_memcached.py | 2 +- + anykeystore/tests/test_backends/test_memory.py | 2 +- + anykeystore/tests/test_backends/test_mongodb.py | 2 +- + anykeystore/tests/test_backends/test_redis.py | 2 +- + anykeystore/tests/test_backends/test_sqla.py | 2 +- + setup.py | 7 +------ + 7 files changed, 7 insertions(+), 12 deletions(-) + +diff --git a/anykeystore/tests/integration/tests.py b/anykeystore/tests/integration/tests.py +index b2a8412..655ebe2 100644 +--- a/anykeystore/tests/integration/tests.py ++++ b/anykeystore/tests/integration/tests.py +@@ -1,6 +1,6 @@ + import os + import time +-import unittest2 as unittest ++import unittest + from ConfigParser import ConfigParser + + +diff --git a/anykeystore/tests/test_backends/test_memcached.py b/anykeystore/tests/test_backends/test_memcached.py +index 5243dba..09db7f4 100644 +--- a/anykeystore/tests/test_backends/test_memcached.py ++++ b/anykeystore/tests/test_backends/test_memcached.py +@@ -1,4 +1,4 @@ +-import unittest2 as unittest ++import unittest + from mock import MagicMock + + class TestMemcachedStore(unittest.TestCase): +diff --git a/anykeystore/tests/test_backends/test_memory.py b/anykeystore/tests/test_backends/test_memory.py +index 6cc8709..863fb07 100644 +--- a/anykeystore/tests/test_backends/test_memory.py ++++ b/anykeystore/tests/test_backends/test_memory.py +@@ -1,4 +1,4 @@ +-import unittest2 as unittest ++import unittest + + class TestMemoryStore(unittest.TestCase): + +diff --git a/anykeystore/tests/test_backends/test_mongodb.py b/anykeystore/tests/test_backends/test_mongodb.py +index e7d91dc..a53488d 100644 +--- a/anykeystore/tests/test_backends/test_mongodb.py ++++ b/anykeystore/tests/test_backends/test_mongodb.py +@@ -1,6 +1,6 @@ + from datetime import datetime, timedelta + +-import unittest2 as unittest ++import unittest + from mock import MagicMock, patch + + class TestMongoStore(unittest.TestCase): +diff --git a/anykeystore/tests/test_backends/test_redis.py b/anykeystore/tests/test_backends/test_redis.py +index ae3e470..1b4e519 100644 +--- a/anykeystore/tests/test_backends/test_redis.py ++++ b/anykeystore/tests/test_backends/test_redis.py +@@ -1,4 +1,4 @@ +-import unittest2 as unittest ++import unittest + from mock import MagicMock, patch + + class TestRedisStore(unittest.TestCase): +diff --git a/anykeystore/tests/test_backends/test_sqla.py b/anykeystore/tests/test_backends/test_sqla.py +index 2184a19..22fa2d0 100644 +--- a/anykeystore/tests/test_backends/test_sqla.py ++++ b/anykeystore/tests/test_backends/test_sqla.py +@@ -1,4 +1,4 @@ +-import unittest2 as unittest ++import unittest + from mock import MagicMock, patch + + class TestSQLStore(unittest.TestCase): +diff --git a/setup.py b/setup.py +index 759dffe..6eade0f 100644 +--- a/setup.py ++++ b/setup.py +@@ -25,11 +25,6 @@ tests_require = requires + [ + 'mock', + ] + +-if PY3: +- tests_require.append('unittest2py3k') +-else: +- tests_require.append('unittest2') +- + setup( + name='anykeystore', + version='0.2', +@@ -56,7 +51,7 @@ setup( + zip_safe=False, + install_requires=requires, + tests_require=tests_require, +- test_suite='unittest2.collector', ++ test_suite='nose.collector', + entry_points="""\ + """, + ) +-- +1.9.3 + diff --git a/python-anykeystore.spec b/python-anykeystore.spec index ffee2c6..a1732e2 100644 --- a/python-anykeystore.spec +++ b/python-anykeystore.spec @@ -1,20 +1,27 @@ +%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 + %global modname anykeystore Name: python-%{modname} Version: 0.2 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A key-value store supporting multiple backends Group: Development/Libraries License: MIT URL: http://pypi.python.org/pypi/%{modname} Source0: http://pypi.python.org/packages/source/a/%{modname}/%{modname}-%{version}.tar.gz +Patch0: python-anykeystore-use-unittest1.patch BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools -BuildRequires: python-unittest2 +BuildRequires: python-nose BuildRequires: python-mock # Optional backends for the tests @@ -23,7 +30,6 @@ BuildRequires: pymongo BuildRequires: python-redis BuildRequires: python-memcached - %description A generic interface wrapping multiple different backends to provide a consistent key-value storage API. This library is intended to be used by @@ -31,31 +37,31 @@ other libraries that require some form of generic storage. %prep %setup -q -n %{modname}-%{version} +%patch0 -p1 %if %{?rhel}%{!?rhel:0} >= 6 rm -rf %{modname}/tests/integration/tests.py %endif - %build -%{__python} setup.py build - +%{__python2} setup.py build %install -%{__python} setup.py install -O1 --skip-build --root=%{buildroot} +%{__python2} setup.py install -O1 --skip-build --root=%{buildroot} %check -%{__python} setup.py test - +%{__python2} setup.py test %files %doc README.rst LICENSE.txt -%{python_sitelib}/%{modname} -%{python_sitelib}/%{modname}-%{version}* - - +%{python2_sitelib}/%{modname} +%{python2_sitelib}/%{modname}-%{version}* %changelog +* Thu Jun 12 2014 Ralph Bean - 0.2-7 +- Modernized python2 macros. +- Patched out use of unittest1 which fails oddly in rawhide. + * Sat Jun 07 2014 Fedora Release Engineering - 0.2-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild