From 0fc91b5bd608e4b320033629d3cebf304b58f4e03aee3c6d27ff3e91510c7a6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sat, 11 Aug 2018 14:28:33 +0000 Subject: [PATCH] - Add patch to fix tests on python3: * invocations-py3.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-invocations?expand=0&rev=10 --- invocations-py3.patch | 19 +++++++++++++++++++ python-invocations.changes | 2 ++ python-invocations.spec | 5 ++++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 invocations-py3.patch diff --git a/invocations-py3.patch b/invocations-py3.patch new file mode 100644 index 0000000..0f9f28a --- /dev/null +++ b/invocations-py3.patch @@ -0,0 +1,19 @@ +Index: invocations-1.4.0/tests/autodoc/base.py +=================================================================== +--- invocations-1.4.0.orig/tests/autodoc/base.py ++++ invocations-1.4.0/tests/autodoc/base.py +@@ -1,4 +1,5 @@ + from os.path import join, dirname ++import codecs + import re + import shutil + +@@ -28,7 +29,7 @@ class autodoc_: + def setup_class(self): + # Build once, introspect many...for now + self.build_dir = _build() +- with open(join(self.build_dir, "api.html")) as fd: ++ with codecs.open(join(self.build_dir, "api.html"), 'r', encoding='utf-8') as fd: + self.api_docs = fd.read() + + @classmethod diff --git a/python-invocations.changes b/python-invocations.changes index 5b29a1b..714717f 100644 --- a/python-invocations.changes +++ b/python-invocations.changes @@ -4,6 +4,8 @@ Sat Aug 11 12:01:52 UTC 2018 - tchvatal@suse.com - Drop the multibuild as the cycle is gone - Add patch to not rely on bundled stuff: * invocations-no-bundled.patch +- Add patch to fix tests on python3: + * invocations-py3.patch ------------------------------------------------------------------- Sat Aug 11 10:01:08 UTC 2018 - tchvatal@suse.com diff --git a/python-invocations.spec b/python-invocations.spec index 098e2e3..428e8c1 100644 --- a/python-invocations.spec +++ b/python-invocations.spec @@ -26,6 +26,7 @@ Group: Development/Languages/Python URL: http://pyinvoke.org Source: https://github.com/pyinvoke/invocations/archive/%{version}.tar.gz Patch0: invocations-no-bundled.patch +Patch1: invocations-py3.patch BuildRequires: %{python_module blessings >= 1.6} BuildRequires: %{python_module invoke >= 1.0} BuildRequires: %{python_module mock} @@ -69,6 +70,7 @@ the Invoke project's communication channels for updates. Thanks! %prep %setup -q -n invocations-%{version} %patch0 -p1 +%patch1 -p1 %build %python_build @@ -78,7 +80,8 @@ the Invoke project's communication channels for updates. Thanks! %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%{python_expand export PYTHONPATH=. +export PYTHONDONTWRITEBYTECODE=1 +%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_bin_suffix} }