diff --git a/0001-Make-tests-pass-with-ipykernel-6.0.0.patch b/0001-Make-tests-pass-with-ipykernel-6.0.0.patch new file mode 100644 index 0000000..fc6a220 --- /dev/null +++ b/0001-Make-tests-pass-with-ipykernel-6.0.0.patch @@ -0,0 +1,31 @@ +From 3e1e6c6f31b86f5fb0e79a6901822dbe62af0891 Mon Sep 17 00:00:00 2001 +From: Chih-Hsuan Yen +Date: Sat, 21 Aug 2021 11:41:01 +0800 +Subject: [PATCH] Make tests pass with ipykernel >= 6.0.0 + +Ref: https://github.com/ipython/ipykernel/pull/685 +--- + tests/test_ignore.py | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +Index: nbval-0.9.6/tests/test_ignore.py +=================================================================== +--- nbval-0.9.6.orig/tests/test_ignore.py ++++ nbval-0.9.6/tests/test_ignore.py +@@ -22,10 +22,13 @@ def test_conf_ignore_stderr(testdir): + + # Setup notebook with stream outputs + nb = build_nb([ ++ # Since ipykernel 6.0.0, sys.stdout.write and sys.stderr.write functions ++ # return the number of written bytes. Capture returned values to avoid extra ++ # text/plain fields. + "import sys", +- "sys.stdout.write('test\\n')", +- "sys.stderr.write('error output\\n')", +- "sys.stdout.write('test\\n')\nsys.stderr.write('error output\\n')", ++ "ret = sys.stdout.write('test\\n')", ++ "ret = sys.stderr.write('error output\\n')", ++ "ret = sys.stdout.write('test\\n')\nret = sys.stderr.write('error output\\n')", + ], mark_run=True) + nb.cells[1].outputs.append(nbformat.v4.new_output( + 'stream', diff --git a/python-nbval.changes b/python-nbval.changes index 6548f9b..d90fd85 100644 --- a/python-nbval.changes +++ b/python-nbval.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Aug 29 13:12:23 UTC 2021 - Ben Greiner + +- Add 0001-Make-tests-pass-with-ipykernel-6.0.0.patch from Arch + ------------------------------------------------------------------- Wed Apr 14 13:53:04 UTC 2021 - Ben Greiner diff --git a/python-nbval.spec b/python-nbval.spec index 39848a7..a099485 100644 --- a/python-nbval.spec +++ b/python-nbval.spec @@ -28,6 +28,9 @@ URL: https://github.com/computationalmodelling/nbval Source: https://files.pythonhosted.org/packages/source/n/nbval/nbval-%{version}.tar.gz # PATCH-FIX-UPSTREAM nbval-filter-mpldeprecation.patch -- gh#computationalmodelling/nbval#167 Patch0: nbval-filter-mpldeprecation.patch +# PATCH-FIX-UPSTREAM 0001-Make-tests-pass-with-ipykernel-6.0.0.patch -- Taken from archlinux, yan12125@gmail.com +# https://github.com/archlinux/svntogit-community/blob/0aeb3d7e25d351606f46becc33f79e1c369572d0/python-nbval/trunk/0001-Make-tests-pass-with-ipykernel-6.0.0.patch (with whitespace changes) +Patch1: 0001-Make-tests-pass-with-ipykernel-6.0.0.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros