diff --git a/.gitignore b/.gitignore index e69de29..4a406bf 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,4 @@ +*~ +*.rpm +*.tar* +results_*/ diff --git a/python-testfixtures-4.13.5-py36.patch b/python-testfixtures-4.13.5-py36.patch new file mode 100644 index 0000000..d0ab831 --- /dev/null +++ b/python-testfixtures-4.13.5-py36.patch @@ -0,0 +1,134 @@ +From d5d98c837e598e017165db941f08a14105caf40e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Wed, 26 Apr 2017 15:02:18 +0200 +Subject: [PATCH 1/3] [Testsuite] Add changes for Python 3.6 + +--- + testfixtures/tests/compat.py | 1 + + testfixtures/tests/test_should_raise.py | 6 +++++- + testfixtures/tests/test_shouldwarn.py | 27 +++++++++++++++++---------- + 3 files changed, 23 insertions(+), 11 deletions(-) + +diff --git a/testfixtures/tests/compat.py b/testfixtures/tests/compat.py +index 112785f..6fe32ba 100644 +--- a/testfixtures/tests/compat.py ++++ b/testfixtures/tests/compat.py +@@ -23,6 +23,7 @@ + py_33_plus = sys.version_info[:2] >= (3, 3) + py_34_plus = sys.version_info[:2] >= (3, 4) + py_35_plus = sys.version_info[:2] >= (3, 5) ++py_36_plus = sys.version_info[:2] >= (3, 6) + + # Python 2.7 compatibility stuff + +diff --git a/testfixtures/tests/test_should_raise.py b/testfixtures/tests/test_should_raise.py +index 58ecdc5..4f860e9 100644 +--- a/testfixtures/tests/test_should_raise.py ++++ b/testfixtures/tests/test_should_raise.py +@@ -5,6 +5,7 @@ + from unittest import TestCase + + from .compat import py_33_plus ++from .compat import py_36_plus + + + class TestShouldRaise(TestCase): +@@ -191,7 +192,10 @@ def test_import_errors_1(self): + message = "No module named 'textfixtures'" + else: + message = 'No module named textfixtures.foo.bar' +- with ShouldRaise(ImportError(message)): ++ ++ exception = ModuleNotFoundError if py_36_plus else ImportError ++ ++ with ShouldRaise(exception(message)): + import textfixtures.foo.bar + + def test_import_errors_2(self): +diff --git a/testfixtures/tests/test_shouldwarn.py b/testfixtures/tests/test_shouldwarn.py +index 3586a09..1e9b49c 100644 +--- a/testfixtures/tests/test_shouldwarn.py ++++ b/testfixtures/tests/test_shouldwarn.py +@@ -13,6 +13,8 @@ + else: + warn_module = 'exceptions' + ++from .compat import py_36_plus ++ + + class ShouldWarnTests(TestCase): + +@@ -106,14 +108,19 @@ def test_maximal_explore(self): + 'foo', DeprecationWarning, 'bar.py', 42, 'bar_module' + ) + compare(len(recorded), expected=1) +- compare(C(warnings.WarningMessage, +- _category_name='DeprecationWarning', +- category=DeprecationWarning, +- file=None, +- filename='bar.py', +- line=None, +- lineno=42, +- message=C(DeprecationWarning('foo')) +- ), recorded[0]) +- + ++ expected_attrs = dict( ++ _category_name='DeprecationWarning', ++ category=DeprecationWarning, ++ file=None, ++ filename='bar.py', ++ line=None, ++ lineno=42, ++ message=C(DeprecationWarning('foo')), ++ ) ++ ++ if py_36_plus: ++ expected_attrs['source'] = None ++ ++ compare(expected=C(warnings.WarningMessage, **expected_attrs), ++ actual=recorded[0]) + +From 29e919a01ee6e26579de964ed7e7e0a5b0171344 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Wed, 26 Apr 2017 17:34:28 +0200 +Subject: [PATCH 2/3] [TravisCI] Add Python 3.6 + +--- + .travis.yml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/.travis.yml b/.travis.yml +index ad19bfb..773c4d2 100644 +--- a/.travis.yml ++++ b/.travis.yml +@@ -4,6 +4,7 @@ language: python + sudo: false + + python: ++ - "3.6" + - "3.5" + - "3.4" + - "3.3" + +From 16a3301237af2c1a3dff4db80a12a625026c1ca5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Wed, 26 Apr 2017 17:35:00 +0200 +Subject: [PATCH 3/3] [setup.py] Add Python 3.6 to supported versions + +--- + setup.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/setup.py b/setup.py +index b58625e..1ed49bb 100644 +--- a/setup.py ++++ b/setup.py +@@ -32,6 +32,7 @@ + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', ++ 'Programming Language :: Python :: 3.6', + ], + packages=find_packages(), + zip_safe=False, diff --git a/python-testfixtures.spec b/python-testfixtures.spec new file mode 100644 index 0000000..8b09769 --- /dev/null +++ b/python-testfixtures.spec @@ -0,0 +1,214 @@ +%if 0%{?fedora} || 0%{?rhel} >= 8 +%bcond_without python3 +%else # 0#{?fedora} || 0#{?rhel} >= 8 +%bcond_with python3 +%endif # 0#{?fedora} || 0#{?rhel} >= 8 + +%global pypi_name testfixtures +%global global_sum Collection of helpers and mock objects for unit tests and doc tests +%global global_desc \ +TestFixtures is a collection of helpers and mock objects that are \ +useful when writing unit tests or doc tests. \ + \ +If you’re wondering why “yet another mock object library”, testing \ +is often described as an art form and as such some styles of library \ +will suit some people while others will suit other styles. This \ +library contains common test fixtures the author found himself \ +repeating from package to package and so decided to extract them \ +into their own library and give them some tests of their own! + + +Name: python-%{pypi_name} +Version: 4.13.5 +Release: 1%{?dist} +Summary: %{global_sum} + +License: MIT +URL: https://pypi.python.org/pypi/%{pypi_name} +Source0: https://files.pythonhosted.org/packages/source/t/%{pypi_name}/%{pypi_name}-%{version}.tar.gz + +# Support for Python 3.6 from upstream. +Patch0: https://github.com/Simplistix/testfixtures/commit/289692d265930c5f6563029125571a851bfa2c6f.patch#/%{name}-4.13.5-py36.patch + +BuildArch: noarch + +%description +%{global_desc} + + +%package doc +Summary: Documentation-files for %{name} + +%description doc +This package contains the documentation-files for %{name}. + + +%package -n python2-%{pypi_name} +Summary: %{global_sum} + +BuildRequires: python2-devel +BuildRequires: python-coveralls +BuildRequires: python-manuel +BuildRequires: python-mock +BuildRequires: python-nose +BuildRequires: python-nose-cov +BuildRequires: python-nose_fixes +BuildRequires: python-pkginfo +BuildRequires: python-setuptools +BuildRequires: python-setuptools_git +BuildRequires: python-sphinx +BuildRequires: python-twine +BuildRequires: python-wheel +BuildRequires: python-zope-component + +%{?python_provide:%python_provide python2-%{pypi_name}} + +%description -n python2-%{pypi_name} +%{global_desc} + + +%package -n python2-%{pypi_name}-tests +Summary: Testsuite for python2-%{pypi_name} + +Requires: python2-%{pypi_name} == %{version}-%{release} +Requires: python-coveralls +Requires: python-manuel +Requires: python-mock +Requires: python-nose +Requires: python-nose-cov +Requires: python-nose_fixes +Requires: python-pkginfo +Requires: python-setuptools +Requires: python-setuptools_git +Requires: python-sphinx +Requires: python-twine +Requires: python-wheel +Requires: python-zope-component + +%{?python_provide:%python_provide python2-%{pypi_name}-tests} + +%description -n python2-%{pypi_name}-tests +This package contains the testsuite for python2-%{pypi_name}. + + +%if %{with python3} +%package -n python3-%{pypi_name} +Summary: %{global_sum} + +BuildRequires: python3-coveralls +BuildRequires: python3-devel +BuildRequires: python3-manuel +BuildRequires: python3-mock +BuildRequires: python3-nose +BuildRequires: python3-nose-cov +BuildRequires: python3-nose_fixes +BuildRequires: python3-pkginfo +BuildRequires: python3-setuptools +BuildRequires: python3-setuptools_git +BuildRequires: python3-sphinx +BuildRequires: python3-twine +BuildRequires: python3-wheel +BuildRequires: python3-zope-component + +%{?python_provide:%python_provide python3-%{pypi_name}} + +%description -n python3-%{pypi_name} +%{global_desc} + + +%package -n python3-%{pypi_name}-tests +Summary: Testsuite for python3-%{pypi_name} + +Requires: python3-%{pypi_name} == %{version}-%{release} +Requires: python3-coveralls +Requires: python3-manuel +Requires: python3-mock +Requires: python3-nose +Requires: python3-nose-cov +Requires: python3-nose_fixes +Requires: python3-pkginfo +Requires: python3-setuptools +Requires: python3-setuptools_git +Requires: python3-sphinx +Requires: python3-twine +Requires: python3-wheel +Requires: python3-zope-component + +%{?python_provide:%python_provide python3-%{pypi_name}-tests} + +%description -n python3-%{pypi_name}-tests +This package contains the testsuite for python3-%{pypi_name}. +%endif # with python3 + + +%prep +%autosetup -n %{pypi_name}-%{version} -p 1 +%{__rm} -fr *.egg* + + +%build +%py2_build +%if %{with python3} +%py3_build +%endif # with python3 +export PYTHONPATH="$PWD/build/lib" +%{__make} -C docs html +unset PYTHONPATH +%{_bindir}/find build/lib -type f -name '*.py?' -print -delete + + +%install +%py2_install +%if %{with python3} +%py3_install +%endif # with python3 +%{__rm} -f docs/_build/html/{.buildinfo,objects.inv} + + +%check +%{_bindir}/nosetests-%{python2_version} -vv +%if %{with python3} +%{_bindir}/nosetests-%{python3_version} -vv +%endif # with python3 + + +%files doc +%doc docs/changes.txt docs/_build/html PKG-INFO +%license LICENSE.txt + + +%files -n python2-%{pypi_name} +%doc PKG-INFO +%license LICENSE.txt +%exclude %{python2_sitelib}/%{pypi_name}/tests +%{python2_sitelib}/%{pypi_name} +%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info + + +%files -n python2-%{pypi_name}-tests +%{python2_sitelib}/%{pypi_name}/tests + + +%if %{with python3} +%files -n python3-%{pypi_name} +%doc PKG-INFO +%license LICENSE.txt +%exclude %{python3_sitelib}/%{pypi_name}/tests +%{python3_sitelib}/%{pypi_name} +%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info + + +%files -n python3-%{pypi_name}-tests +%{python3_sitelib}/%{pypi_name}/tests +%endif # with python3 + + +%changelog +* Wed Apr 26 2017 Björn Esser - 4.13.5-1 +- Initial import (rhbz#1445824) + +* Wed Apr 26 2017 Björn Esser - 4.13.5-0.2 +- Fix E: python-bytecode-wrong-magic-value + +* Wed Apr 26 2017 Björn Esser - 4.13.5-0.1 +- Initial rpm-release (rhbz#1445824) diff --git a/sources b/sources index e69de29..3cb4279 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +SHA512 (testfixtures-4.13.5.tar.gz) = ed18792bef0f62d8e47e11d1d9138dedf63903510d3d5fc829a8e5041f2d1986353f4678ddf50a0c60ec48055408145d89799ddf866eb3ce1b78d4936e8048ce