From 5962f9135b0557b2da475725002d39e8e479428b700201bc664916bdad081e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Fri, 10 Aug 2018 11:27:57 +0000 Subject: [PATCH 1/4] - Add patch to build with python 3.7: * testtools-py37.patch - Remove unittest2 dependency, it is needed only on python2.6 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-testtools?expand=0&rev=56 --- python-testtools.changes | 7 ++++++ python-testtools.spec | 15 ++++++----- testtools-py37.patch | 54 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 8 deletions(-) create mode 100644 testtools-py37.patch diff --git a/python-testtools.changes b/python-testtools.changes index 8adb059..8d43801 100644 --- a/python-testtools.changes +++ b/python-testtools.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Aug 10 11:27:08 UTC 2018 - tchvatal@suse.com + +- Add patch to build with python 3.7: + * testtools-py37.patch +- Remove unittest2 dependency, it is needed only on python2.6 + ------------------------------------------------------------------- Thu Mar 8 10:17:39 UTC 2018 - aplanas@suse.com diff --git a/python-testtools.spec b/python-testtools.spec index e6ef0c9..e7046f1 100644 --- a/python-testtools.spec +++ b/python-testtools.spec @@ -23,9 +23,9 @@ Release: 0 Summary: Extensions to the Python Standard Library Unit Testing Framework License: MIT Group: Development/Languages/Python -Url: https://launchpad.net/testtools -Source: https://pypi.io/packages/source/t/testtools/testtools-%{version}.tar.gz -BuildRequires: %{python_module devel} +URL: https://github.com/testing-cabal/testtools +Source: https://files.pythonhosted.org/packages/source/t/testtools/testtools-%{version}.tar.gz +Patch0: testtools-py37.patch BuildRequires: %{python_module extras >= 1.0.0} BuildRequires: %{python_module pbr} BuildRequires: %{python_module setuptools} @@ -36,12 +36,10 @@ Requires: python-pbr >= 0.11 Requires: python-python-mimeparse Requires: python-six >= 1.4.0 Requires: python-traceback2 -Requires: python-unittest2 >= 1.0.0 +BuildArch: noarch %if 0%{?suse_version} >= 1000 || 0%{?fedora_version} >= 24 Recommends: python-fixtures >= 1.3.0 %endif -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildArch: noarch %python_subpackages %description @@ -52,6 +50,7 @@ also ports recent unittest changes all the way back to Python 2.4. %prep %setup -q -n testtools-%{version} +%patch0 -p1 %build %python_build @@ -61,8 +60,8 @@ also ports recent unittest changes all the way back to Python 2.4. %python_expand %fdupes -s %{buildroot}%{$python_sitelib} %files %{python_files} -%defattr(-,root,root,-) -%doc LICENSE NEWS README.rst +%license LICENSE +%doc NEWS README.rst %{python_sitelib}/testtools %{python_sitelib}/testtools-%{version}-py*.egg-info diff --git a/testtools-py37.patch b/testtools-py37.patch new file mode 100644 index 0000000..c737cf0 --- /dev/null +++ b/testtools-py37.patch @@ -0,0 +1,54 @@ +From 29004731f9c480b7c44a9c2605513d50d372898f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Thu, 17 May 2018 17:52:26 +0200 +Subject: [PATCH] Fix the tests on Python 3.7 + +Exception's repr got changed not to include trailing comma + +Fixes https://github.com/testing-cabal/testtools/issues/270 +--- + .travis.yml | 1 + + testtools/tests/matchers/test_exception.py | 11 +++++++++-- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/.travis.yml b/.travis.yml +index 7f1f4db7..784608e0 100644 +--- a/.travis.yml ++++ b/.travis.yml +@@ -5,6 +5,7 @@ python: + - "3.4" + - "3.5" + - "3.6" ++ - "3.7-dev" + - "pypy" + + install: +diff --git a/testtools/tests/matchers/test_exception.py b/testtools/tests/matchers/test_exception.py +index 6cd80af1..acd39252 100644 +--- a/testtools/tests/matchers/test_exception.py ++++ b/testtools/tests/matchers/test_exception.py +@@ -32,15 +32,22 @@ class TestMatchesExceptionInstanceInterface(TestCase, TestMatchersInterface): + matches_matches = [error_foo] + matches_mismatches = [error_bar, error_base_foo] + ++ if sys.version_info >= (3, 7): ++ # exception's repr has changed ++ _e = '' ++ else: ++ _e = ',' ++ + str_examples = [ +- ("MatchesException(Exception('foo',))", ++ ("MatchesException(Exception('foo'%s))" % _e, + MatchesException(Exception('foo'))) + ] + describe_examples = [ + ("%r is not a %r" % (Exception, ValueError), + error_base_foo, + MatchesException(ValueError("foo"))), +- ("ValueError('bar',) has different arguments to ValueError('foo',).", ++ ("ValueError('bar'%s) has different arguments to ValueError('foo'%s)." ++ % (_e, _e), + error_bar, + MatchesException(ValueError("foo"))), + ] From 1b3076928a38d2a66f03c85db6f168b99723150e4403c0be22b79c615f36e1a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sat, 11 Aug 2018 08:05:17 +0000 Subject: [PATCH 2/4] - Really run the tests OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-testtools?expand=0&rev=57 --- python-testtools-doc.changes | 5 +++++ python-testtools-doc.spec | 27 +++++++++------------------ python-testtools.changes | 1 - python-testtools.spec | 2 ++ 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/python-testtools-doc.changes b/python-testtools-doc.changes index 636a5dc..8ab88f3 100644 --- a/python-testtools-doc.changes +++ b/python-testtools-doc.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Aug 11 08:04:56 UTC 2018 - tchvatal@suse.com + +- Really run the tests + ------------------------------------------------------------------- Tue Jul 4 04:07:32 UTC 2017 - tbechtold@suse.com diff --git a/python-testtools-doc.spec b/python-testtools-doc.spec index 3080103..d6dc505 100644 --- a/python-testtools-doc.spec +++ b/python-testtools-doc.spec @@ -23,21 +23,16 @@ Release: 0 Summary: Documentation for python-testtools License: MIT Group: Documentation/HTML -Url: https://launchpad.net/testtools -Source: https://pypi.io/packages/source/t/testtools/testtools-%{version}.tar.gz -BuildRequires: %{python_module testtools = %{version}} -BuildRequires: python-rpm-macros -%if %{with tests} -# Test requirement -BuildRequires: %{python_module testscenarios = %{version}} -BuildRequires: %{python_module unittest2 >= 0.8.0} -%endif -# Documentation requirements: +URL: https://launchpad.net/testtools +Source: https://files.pythonhosted.org/packages/source/t/testtools/testtools-%{version}.tar.gz +Patch0: testtools-py37.patch +BuildRequires: %{python_module testscenarios} +BuildRequires: %{python_module testtools = %{version}} BuildRequires: fdupes +BuildRequires: python-rpm-macros BuildRequires: python3-Sphinx Provides: python2-testtools-doc = %{version} Provides: python3-testtools-doc = %{version} -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch %description @@ -45,6 +40,7 @@ Documentation and help files for python-testtools. %prep %setup -q -n testtools-%{version} +%patch0 -p1 %build python3 setup.py build_sphinx && rm build/sphinx/html/.buildinfo @@ -54,16 +50,11 @@ mkdir -p %{buildroot}%{_docdir}/python-testtools/ cp -r build/sphinx/html %{buildroot}%{_docdir}/python-testtools/ %fdupes %{buildroot}%{_docdir} -# A build cycle exists between python-extras and python-testtools. -# Doing the tests in a separate package avoids this cycle. -%if %{with tests} %check -%{python_exec} -m testtools.run testtools.tests.test_suite -%endif +%python_exec -m testtools.run testtools.tests.test_suite %files -%defattr(-,root,root,-) -%doc LICENSE +%license LICENSE %{_docdir}/python-testtools/ %changelog diff --git a/python-testtools.changes b/python-testtools.changes index 8d43801..8ba0607 100644 --- a/python-testtools.changes +++ b/python-testtools.changes @@ -3,7 +3,6 @@ Fri Aug 10 11:27:08 UTC 2018 - tchvatal@suse.com - Add patch to build with python 3.7: * testtools-py37.patch -- Remove unittest2 dependency, it is needed only on python2.6 ------------------------------------------------------------------- Thu Mar 8 10:17:39 UTC 2018 - aplanas@suse.com diff --git a/python-testtools.spec b/python-testtools.spec index e7046f1..5a1d6de 100644 --- a/python-testtools.spec +++ b/python-testtools.spec @@ -36,6 +36,7 @@ Requires: python-pbr >= 0.11 Requires: python-python-mimeparse Requires: python-six >= 1.4.0 Requires: python-traceback2 +Requires: python-unittest2 BuildArch: noarch %if 0%{?suse_version} >= 1000 || 0%{?fedora_version} >= 24 Recommends: python-fixtures >= 1.3.0 @@ -51,6 +52,7 @@ also ports recent unittest changes all the way back to Python 2.4. %prep %setup -q -n testtools-%{version} %patch0 -p1 +%patch1 -p1 %build %python_build From 54ad2bbbbb1f6f4872174c8dff14f33712cf08f863138806718c5df9e422c731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sat, 11 Aug 2018 08:06:17 +0000 Subject: [PATCH 3/4] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-testtools?expand=0&rev=58 --- python-testtools.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-testtools.spec b/python-testtools.spec index 5a1d6de..87e0d41 100644 --- a/python-testtools.spec +++ b/python-testtools.spec @@ -36,7 +36,7 @@ Requires: python-pbr >= 0.11 Requires: python-python-mimeparse Requires: python-six >= 1.4.0 Requires: python-traceback2 -Requires: python-unittest2 +Requires: python-unittest2 >= 1.1.0 BuildArch: noarch %if 0%{?suse_version} >= 1000 || 0%{?fedora_version} >= 24 Recommends: python-fixtures >= 1.3.0 From 8f9e912be4597d2e079c45e8885ced6c4e2add25c85999d2c306fa4f3d234bca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sat, 11 Aug 2018 08:39:24 +0000 Subject: [PATCH 4/4] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-testtools?expand=0&rev=59 --- python-testtools.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-testtools.spec b/python-testtools.spec index 87e0d41..9201654 100644 --- a/python-testtools.spec +++ b/python-testtools.spec @@ -52,7 +52,7 @@ also ports recent unittest changes all the way back to Python 2.4. %prep %setup -q -n testtools-%{version} %patch0 -p1 -%patch1 -p1 + %build %python_build