diff --git a/0001-Make-tests-pass-with-ipykernel-6.0.0.patch b/0001-Make-tests-pass-with-ipykernel-6.0.0.patch deleted file mode 100644 index fc6a220..0000000 --- a/0001-Make-tests-pass-with-ipykernel-6.0.0.patch +++ /dev/null @@ -1,31 +0,0 @@ -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/nbval-0.10.0.tar.gz b/nbval-0.10.0.tar.gz new file mode 100644 index 0000000..9a36e0b --- /dev/null +++ b/nbval-0.10.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4acefdc1132aef8a1b5b62bf9a93d128eba52839b2854ea3e42598f4db7beb3 +size 62727 diff --git a/nbval-0.9.6.tar.gz b/nbval-0.9.6.tar.gz deleted file mode 100644 index 24c593e..0000000 --- a/nbval-0.9.6.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cfefcd2ef66ee2d337d0b252c6bcec4023384eb32e8b9e5fcc3ac80ab8cd7d40 -size 60932 diff --git a/nbval-filter-mpldeprecation.patch b/nbval-filter-mpldeprecation.patch deleted file mode 100644 index fff7e88..0000000 --- a/nbval-filter-mpldeprecation.patch +++ /dev/null @@ -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\"])" diff --git a/nbval-sanitize-figure-size.patch b/nbval-sanitize-figure-size.patch deleted file mode 100644 index 033aebd..0000000 --- a/nbval-sanitize-figure-size.patch +++ /dev/null @@ -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 diff --git a/python-nbval.changes b/python-nbval.changes index 1e9d20b..66ef3c5 100644 --- a/python-nbval.changes +++ b/python-nbval.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sun Jan 15 20:30:34 UTC 2023 - Ben Greiner + +- 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 diff --git a/python-nbval.spec b/python-nbval.spec index c75fdc5..fdae7ea 100644 --- a/python-nbval.spec +++ b/python-nbval.spec @@ -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