forked from pool/python-nbclient
Compare commits
3 Commits
Author | SHA256 | Date | |
---|---|---|---|
|
e38468cb6c | ||
8bee97b25c | |||
f8c4c65958 |
40
nbclient-pr315-date-deprecation.patch
Normal file
40
nbclient-pr315-date-deprecation.patch
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
From eb6aa1fe35a2e7e9d22a7bdba82fd1c7894ac243 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
||||||
|
Date: Mon, 10 Jun 2024 17:08:06 +0200
|
||||||
|
Subject: [PATCH] Avoid a DeprecationWarning on Python 3.13+
|
||||||
|
|
||||||
|
...
|
||||||
|
/usr/lib/python3.13/site-packages/nbclient/jsonutil.py:29: in <module>
|
||||||
|
datetime.strptime("1", "%d")
|
||||||
|
/usr/lib64/python3.13/_strptime.py:573: in _strptime_datetime
|
||||||
|
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
|
||||||
|
/usr/lib64/python3.13/_strptime.py:336: in _strptime
|
||||||
|
format_regex = _TimeRE_cache.compile(format)
|
||||||
|
/usr/lib64/python3.13/_strptime.py:282: in compile
|
||||||
|
return re_compile(self.pattern(format), IGNORECASE)
|
||||||
|
/usr/lib64/python3.13/_strptime.py:270: in pattern
|
||||||
|
warnings.warn("""\
|
||||||
|
E DeprecationWarning: Parsing dates involving a day of month without a year specified is ambiguious
|
||||||
|
E and fails to parse leap day. The default behavior will change in Python 3.15
|
||||||
|
E to either always raise an exception or to use a different default year (TBD).
|
||||||
|
E To avoid trouble, add a specific year to the input & format.
|
||||||
|
E See https://github.com/python/cpython/issues/70647.
|
||||||
|
|
||||||
|
See also https://github.com/jupyter/jupyter_client/issues/1020
|
||||||
|
---
|
||||||
|
nbclient/jsonutil.py | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/nbclient/jsonutil.py b/nbclient/jsonutil.py
|
||||||
|
index bad0dae..0cd1236 100644
|
||||||
|
--- a/nbclient/jsonutil.py
|
||||||
|
+++ b/nbclient/jsonutil.py
|
||||||
|
@@ -26,7 +26,7 @@
|
||||||
|
|
||||||
|
# holy crap, strptime is not threadsafe.
|
||||||
|
# Calling it once at import seems to help.
|
||||||
|
-datetime.strptime("1", "%d")
|
||||||
|
+datetime.strptime("2000-01-01", "%Y-%m-%d")
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
# Classes and functions
|
35
nbclient-pr317-py313tests.patch
Normal file
35
nbclient-pr317-py313tests.patch
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
From 57222265bfd8bdcf8851997e1dce5cd564e1a573 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Lumir Balhar <lbalhar@redhat.com>
|
||||||
|
Date: Wed, 3 Jul 2024 14:21:41 +0200
|
||||||
|
Subject: [PATCH] Fix compatibility with Python 3.13 beta 2
|
||||||
|
|
||||||
|
There are more calls in 3.13 than in previous versions
|
||||||
|
so the tests are now more permissive.
|
||||||
|
|
||||||
|
Fixes: https://github.com/jupyter/nbclient/issues/316
|
||||||
|
---
|
||||||
|
tests/test_cli.py | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/tests/test_cli.py b/tests/test_cli.py
|
||||||
|
index 04b9887..55ccbd6 100644
|
||||||
|
--- a/tests/test_cli.py
|
||||||
|
+++ b/tests/test_cli.py
|
||||||
|
@@ -60,7 +60,7 @@ def test_mult(input_names, relative, inplace, jupyterapp, client, reader, writer
|
||||||
|
# add suffix if needed
|
||||||
|
paths = [p.with_suffix(".ipynb") for p in paths]
|
||||||
|
|
||||||
|
- assert path_open.mock_calls[::3] == [call(p) for p in paths]
|
||||||
|
+ assert all(call(p) in path_open.mock_calls for p in paths)
|
||||||
|
assert reader.call_count == len(paths)
|
||||||
|
# assert reader.mock_calls == [call(p, as_version=4) for p in paths]
|
||||||
|
|
||||||
|
@@ -114,7 +114,7 @@ def test_output(input_names, relative, output_base, jupyterapp, client, reader,
|
||||||
|
# add suffix if needed
|
||||||
|
paths = [p.with_suffix(".ipynb") for p in paths]
|
||||||
|
|
||||||
|
- assert path_open.mock_calls[::3] == [call(p) for p in paths]
|
||||||
|
+ assert all(call(p) in path_open.mock_calls for p in paths)
|
||||||
|
assert reader.call_count == len(paths)
|
||||||
|
|
||||||
|
expected = []
|
@ -1,3 +1,17 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Nov 21 22:28:41 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
|
||||||
|
|
||||||
|
- Remove color from logs.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Nov 21 18:57:39 UTC 2024 - Ben Greiner <code@bnavigator.de>
|
||||||
|
|
||||||
|
- Add nbclient-pr315-date-deprecation.patch
|
||||||
|
* Avoids DeprecationWarning when importing
|
||||||
|
* gh#jupyter/nbclient#315 gh#jupyter/nbclient#318
|
||||||
|
- Add nbclient-pr317-py313tests.patch gh#jupyter/nbclient#317
|
||||||
|
* make tests more lenient
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Jun 26 01:36:57 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
Wed Jun 26 01:36:57 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
@ -38,6 +38,10 @@ Summary: A client library for executing notebooks
|
|||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
URL: https://github.com/jupyter/nbclient
|
URL: https://github.com/jupyter/nbclient
|
||||||
Source: https://files.pythonhosted.org/packages/source/n/nbclient/nbclient-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/n/nbclient/nbclient-%{version}.tar.gz
|
||||||
|
# PATCH-FIX-UPSTREAM nbclient-pr315-date-deprecation.patch gh#jupyter/nbclient#315 gh#jupyter/nbclient#318
|
||||||
|
Patch0: nbclient-pr315-date-deprecation.patch
|
||||||
|
# PATCH-FIX-UPSTREAM nbclient-pr317-py313tests.patch gh#jupyter/nbclient#317
|
||||||
|
Patch1: nbclient-pr317-py313tests.patch
|
||||||
BuildRequires: %{python_module base >= 3.8}
|
BuildRequires: %{python_module base >= 3.8}
|
||||||
BuildRequires: %{python_module hatchling >= 1.10.0}
|
BuildRequires: %{python_module hatchling >= 1.10.0}
|
||||||
BuildRequires: %{python_module pip}
|
BuildRequires: %{python_module pip}
|
||||||
@ -76,7 +80,7 @@ ExecutePreprocessor.
|
|||||||
NBClient is a tool for parameterizing andexecuting Jupyter Notebooks.
|
NBClient is a tool for parameterizing andexecuting Jupyter Notebooks.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n nbclient-%{version}
|
%autosetup -p1 -n nbclient-%{version}
|
||||||
sed -i 's/, "--color=yes"//' pyproject.toml
|
sed -i 's/, "--color=yes"//' pyproject.toml
|
||||||
|
|
||||||
%if ! %{with test}
|
%if ! %{with test}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user