Hello community, here is the log from the commit of package python-mock for openSUSE:Factory checked in at 2014-02-13 15:10:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-mock (Old) and /work/SRC/openSUSE:Factory/.python-mock.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mock" Changes: -------- --- /work/SRC/openSUSE:Factory/python-mock/python-mock.changes 2013-10-25 11:22:08.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-mock.new/python-mock.changes 2014-02-13 15:10:47.000000000 +0100 @@ -1,0 +2,12 @@ +Wed Feb 12 10:30:21 UTC 2014 - [email protected] + +- Replace python27x.diff with mock-unittest2py27.patch +- Rather use "setup.py test" + +------------------------------------------------------------------- +Mon Feb 10 17:01:11 UTC 2014 - [email protected] + +- add python27x.diff: Avoid dependency on unittest2 for anything + newer than Python 2.7.x + +------------------------------------------------------------------- New: ---- mock-unittest2py27.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-mock.spec ++++++ --- /var/tmp/diff_new_pack.q1Owdo/_old 2014-02-13 15:10:48.000000000 +0100 +++ /var/tmp/diff_new_pack.q1Owdo/_new 2014-02-13 15:10:48.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-mock # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,10 +24,14 @@ License: BSD-3-Clause Group: Development/Languages/Python Source: http://pypi.python.org/packages/source/m/mock/mock-%{version}.tar.gz +# PATCH-FIX-UPSTREAM [email protected] -- http://code.google.com/p/mock/issues/detail?id=194 +Patch0: mock-unittest2py27.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: python-devel BuildRequires: python-setuptools +%if 0%{?suse_version} && 0%{?suse_version} < 1140 BuildRequires: python-unittest2 +%endif %if 0%{?suse_version} && 0%{?suse_version} <= 1110 %{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %else @@ -43,6 +47,7 @@ %prep %setup -q -n mock-%{version} +%patch0 -p1 rm -rf html/.doctrees # Remove junk %build @@ -52,7 +57,7 @@ python setup.py install --prefix=%{_prefix} --root=%{buildroot} %check -unit2 discover +python setup.py test %files %defattr(-,root,root,-) ++++++ mock-unittest2py27.patch ++++++ # HG changeset patch # User Sascha Peilicke <[email protected]> # Date 1392200447 -3600 # Wed Feb 12 11:20:47 2014 +0100 # Node ID 3f15152f49e49e745d63e066b23b482454c67fc9 # Parent d356250e275daa62b2972521885f42fa639341e6 Fix unittest2 check for Python-2.7 The features of unittest2 are available from py2.7+ or py3.2+. Fix the test accordingly. While at it, simplify other related tests. diff -r d356250e275d -r 3f15152f49e4 setup.py --- a/setup.py Tue Apr 09 14:53:33 2013 +0100 +++ b/setup.py Wed Feb 12 11:20:47 2014 +0100 @@ -7,6 +7,7 @@ from mock import __version__ import os +import sys NAME = 'mock' @@ -66,7 +67,11 @@ except ImportError: from distutils.core import setup else: - params['tests_require'] = ['unittest2'] - params['test_suite'] = 'unittest2.collector' + info = sys.version_info[:3] + if info >= (3, 2, 0) or (info[0] == 2 and info >= (2, 7, 0)): + params['test_suite'] = 'tests' + else: + params['tests_require'] = ['unittest2'] + params['test_suite'] = 'unittest2.collector' setup(**params) diff -r d356250e275d -r 3f15152f49e4 tests/support.py --- a/tests/support.py Tue Apr 09 14:53:33 2013 +0100 +++ b/tests/support.py Wed Feb 12 11:20:47 2014 +0100 @@ -1,8 +1,11 @@ import sys -info = sys.version_info -if info[:3] >= (3, 2, 0): - # for Python 3.2 ordinary unittest is fine +info = sys.version_info[:3] +inPy3k = info[0] == 3 +with_available = info >= (2, 5, 0) + +if info >= (3, 2, 0) or (info[0] == 2 and info >= (2, 7, 0)): + # for Python 3.2+ or 2.7+ ordinary unittest is fine import unittest as unittest2 else: import unittest2 @@ -15,10 +18,6 @@ return hasattr(obj, '__call__') -inPy3k = sys.version_info[0] == 3 -with_available = sys.version_info[:2] >= (2, 5) - - def is_instance(obj, klass): """Version of is_instance that doesn't access __class__""" return issubclass(type(obj), klass) -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
