SHA256
1
0
forked from pool/python-nbval

Accepting request 917675 from devel:languages:python:jupyter

OBS-URL: https://build.opensuse.org/request/show/917675
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nbval?expand=0&rev=9
This commit is contained in:
Dominique Leuenberger 2021-09-09 21:07:35 +00:00 committed by Git OBS Bridge
commit c9307488f2
3 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,31 @@
From 3e1e6c6f31b86f5fb0e79a6901822dbe62af0891 Mon Sep 17 00:00:00 2001
From: Chih-Hsuan Yen <yan12125@gmail.com>
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',

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Sun Aug 29 13:12:23 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Add 0001-Make-tests-pass-with-ipykernel-6.0.0.patch from Arch
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Apr 14 13:53:04 UTC 2021 - Ben Greiner <code@bnavigator.de> Wed Apr 14 13:53:04 UTC 2021 - Ben Greiner <code@bnavigator.de>

View File

@ -28,6 +28,9 @@ URL: https://github.com/computationalmodelling/nbval
Source: https://files.pythonhosted.org/packages/source/n/nbval/nbval-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/n/nbval/nbval-%{version}.tar.gz
# PATCH-FIX-UPSTREAM nbval-filter-mpldeprecation.patch -- gh#computationalmodelling/nbval#167 # PATCH-FIX-UPSTREAM nbval-filter-mpldeprecation.patch -- gh#computationalmodelling/nbval#167
Patch0: nbval-filter-mpldeprecation.patch 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: %{python_module setuptools}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros