[packages/python3-nbformat] fix tests with python >= 3.12; rel 7
atler
atler at pld-linux.org
Sat Apr 19 17:07:41 CEST 2025
commit f74653af5b44e1cebac057a9d0cebcc1832908e1
Author: Jan Palus <atler at pld-linux.org>
Date: Sat Apr 19 16:34:23 2025 +0200
fix tests with python >= 3.12; rel 7
assertRegexpMatches renamed to assertRegex in python 3.2 and deprecated
alias "assertRegexpMatches" was dropped in python 3.12
python-3.12.patch | 15 +++++++++++++++
python3-nbformat.spec | 4 +++-
2 files changed, 18 insertions(+), 1 deletion(-)
---
diff --git a/python3-nbformat.spec b/python3-nbformat.spec
index c0add17..7e58d58 100644
--- a/python3-nbformat.spec
+++ b/python3-nbformat.spec
@@ -7,13 +7,14 @@ Summary: The Jupyter Notebook Format
Summary(pl.UTF-8): Format Jupyter Notebook
Name: python3-nbformat
Version: 5.0.5
-Release: 6
+Release: 7
License: BSD
Group: Libraries/Python
#Source0Download: https://pypi.org/simple/nbformat/
Source0: https://files.pythonhosted.org/packages/source/n/nbformat/nbformat-%{version}.tar.gz
# Source0-md5: b519838bfe4765cda1885936db4a2bea
Patch0: %{name}-use_setuptools.patch
+Patch1: python-3.12.patch
URL: https://pypi.org/project/nbformat/
BuildRequires: python3-modules >= 1:3.5
BuildRequires: python3-setuptools
@@ -61,6 +62,7 @@ Dokumentacja API modułu Pythona nbformat.
%prep
%setup -q -n nbformat-%{version}
%patch -P 0 -p1
+%patch -P 1 -p1
%build
%py3_build
diff --git a/python-3.12.patch b/python-3.12.patch
new file mode 100644
index 0000000..5dec030
--- /dev/null
+++ b/python-3.12.patch
@@ -0,0 +1,15 @@
+--- nbformat-5.0.5/nbformat/tests/test_validator.py.orig 2020-01-06 22:02:54.000000000 +0100
++++ nbformat-5.0.5/nbformat/tests/test_validator.py 2025-04-19 16:30:56.495634484 +0200
+@@ -95,9 +95,9 @@
+ with self.assertRaises(ValidationError) as e:
+ validate(nb)
+ s = str(e.exception)
+- self.assertRegexpMatches(s, "validating.*required.* in markdown_cell")
+- self.assertRegexpMatches(s, "source.* is a required property")
+- self.assertRegexpMatches(s, r"On instance\[u?['\"].*cells['\"]\]\[0\]")
++ self.assertRegex(s, "validating.*required.* in markdown_cell")
++ self.assertRegex(s, "source.* is a required property")
++ self.assertRegex(s, r"On instance\[u?['\"].*cells['\"]\]\[0\]")
+ self.assertLess(len(s.splitlines()), 10)
+
+ def test_iter_validation_error(self):
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-nbformat.git/commitdiff/f74653af5b44e1cebac057a9d0cebcc1832908e1
More information about the pld-cvs-commit
mailing list