forked from pool/python-nbval
Accepting request 1060261 from home:bnavigator:branches:devel:languages:python:jupyter
- Update to 0.10.0 * no release notes - Drop nbval-filter-mpldeprecation.patch - Drop nbval-sanitize-figure-size.patch - Drop 0001-Make-tests-pass-with-ipykernel-6.0.0.patch OBS-URL: https://build.opensuse.org/request/show/1060261 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-nbval?expand=0&rev=22
This commit is contained in:
parent
a1f2757b89
commit
dfd1823aaf
@ -1,31 +0,0 @@
|
||||
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',
|
BIN
nbval-0.10.0.tar.gz
(Stored with Git LFS)
Normal file
BIN
nbval-0.10.0.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cfefcd2ef66ee2d337d0b252c6bcec4023384eb32e8b9e5fcc3ac80ab8cd7d40
|
||||
size 60932
|
@ -1,32 +0,0 @@
|
||||
Index: nbval-0.9.6/tests/ipynb-test-samples/test-latex-pass-correctouput.ipynb
|
||||
===================================================================
|
||||
--- nbval-0.9.6.orig/tests/ipynb-test-samples/test-latex-pass-correctouput.ipynb
|
||||
+++ nbval-0.9.6/tests/ipynb-test-samples/test-latex-pass-correctouput.ipynb
|
||||
@@ -37,6 +37,9 @@
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
+ "import warnings\n",
|
||||
+ "from matplotlib import MatplotlibDeprecationWarning\n",
|
||||
+ "warnings.filterwarnings(\"ignore\", category=MatplotlibDeprecationWarning)\n",
|
||||
"x**2 + y**3"
|
||||
]
|
||||
}
|
||||
Index: nbval-0.9.6/tests/latex-example.ipynb
|
||||
===================================================================
|
||||
--- nbval-0.9.6.orig/tests/latex-example.ipynb
|
||||
+++ nbval-0.9.6/tests/latex-example.ipynb
|
||||
@@ -15,6 +15,13 @@
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
+ "try:\n",
|
||||
+ " import warnings\n",
|
||||
+ " from matplotlib import MatplotlibDeprecationWarning\n",
|
||||
+ " warnings.filterwarnings(\"ignore\", category=MatplotlibDeprecationWarning)\n",
|
||||
+ "except ImportError:\n",
|
||||
+ " # no matplotlib, no problem\n",
|
||||
+ " pass\n",
|
||||
"import sympy\n",
|
||||
"sympy.init_printing()\n",
|
||||
"x, y = sympy.symbols([\"x\", \"y\"])"
|
@ -1,15 +0,0 @@
|
||||
Index: nbval-0.9.6/tests/sanitize_defaults.cfg
|
||||
===================================================================
|
||||
--- nbval-0.9.6.orig/tests/sanitize_defaults.cfg
|
||||
+++ nbval-0.9.6/tests/sanitize_defaults.cfg
|
||||
@@ -13,4 +13,8 @@ replace: TIMESTAMP
|
||||
|
||||
[Memory addresses]
|
||||
regex: (<[a-zA-Z_][0-9a-zA-Z_.]* at )(0x[0-9a-fA-F]+)(>)
|
||||
-replace: \1MEMORY_ADDRESS\3
|
||||
\ No newline at end of file
|
||||
+replace: \1MEMORY_ADDRESS\3
|
||||
+
|
||||
+[Matplotlib figure size]
|
||||
+regex: (Figure size )\d+x\d+( with \d+ Axes)
|
||||
+replace: \1WIDTHxHEIGHT\2
|
@ -1,3 +1,12 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Jan 15 20:30:34 UTC 2023 - Ben Greiner <code@bnavigator.de>
|
||||
|
||||
- Update to 0.10.0
|
||||
* no release notes
|
||||
- Drop nbval-filter-mpldeprecation.patch
|
||||
- Drop nbval-sanitize-figure-size.patch
|
||||
- Drop 0001-Make-tests-pass-with-ipykernel-6.0.0.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Aug 20 17:48:52 UTC 2022 - Ben Greiner <code@bnavigator.de>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file
|
||||
#
|
||||
# Copyright (c) 2022 SUSE LLC
|
||||
# Copyright (c) 2023 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -25,24 +25,19 @@
|
||||
%bcond_with test
|
||||
%endif
|
||||
|
||||
%{?!python_module:%define python_module() python3-%{**}}
|
||||
%define skip_python2 1
|
||||
Name: python-nbval%{psuffix}
|
||||
Version: 0.9.6
|
||||
Version: 0.10.0
|
||||
Release: 0
|
||||
Summary: A pytest plugin to validate Jupyter notebooks
|
||||
License: BSD-3-Clause
|
||||
Group: Development/Languages/Python
|
||||
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
|
||||
# PATCH-FIX-UPSTREAM nbval-sanitize-figure-size.patch gh#computationalmodelling/nbval#183
|
||||
Patch2: nbval-sanitize-figure-size.patch
|
||||
BuildRequires: %{python_module base >= 3.6}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-coverage
|
||||
@ -50,14 +45,15 @@ Requires: python-ipykernel
|
||||
Requires: python-jupyter-client
|
||||
Requires: python-nbformat
|
||||
Requires: python-pytest >= 2.8
|
||||
Requires: python-six
|
||||
Provides: python-jupyter_nbval = %{version}
|
||||
Obsoletes: python-jupyter_nbval < %{version}
|
||||
BuildArch: noarch
|
||||
%if %{with test}
|
||||
BuildRequires: %{python_module matplotlib}
|
||||
BuildRequires: %{python_module nbdime}
|
||||
BuildRequires: %{python_module nbval = %{version}}
|
||||
BuildRequires: %{python_module pytest-cov}
|
||||
BuildRequires: %{python_module pytest-mock}
|
||||
BuildRequires: %{python_module sympy}
|
||||
%endif
|
||||
%if "%{python_flavor}" == "python3" || "%{?python_provides}" == "python3"
|
||||
@ -85,11 +81,11 @@ sed -i 's/\r$//' README.md
|
||||
%if ! %{with test}
|
||||
%build
|
||||
export LANG=en_US.UTF-8
|
||||
%python_build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
export LANG=en_US.UTF-8
|
||||
%python_install
|
||||
%pyproject_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
%endif
|
||||
|
||||
@ -97,8 +93,8 @@ export LANG=en_US.UTF-8
|
||||
%check
|
||||
# see dodo.py for call signature
|
||||
%{pytest tests/ --nbval \
|
||||
--current-env \
|
||||
--sanitize-with tests/sanitize_defaults.cfg \
|
||||
--nbval-current-env \
|
||||
--nbval-sanitize-with tests/sanitize_defaults.cfg \
|
||||
--ignore tests/ipynb-test-samples
|
||||
}
|
||||
%endif
|
||||
@ -108,7 +104,7 @@ export LANG=en_US.UTF-8
|
||||
%doc README.md
|
||||
%license LICENSE
|
||||
%{python_sitelib}/nbval
|
||||
%{python_sitelib}/nbval-%{version}*-info
|
||||
%{python_sitelib}/nbval-%{version}.dist-info
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
Loading…
Reference in New Issue
Block a user