Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-nbsmoke for openSUSE:Factory 
checked in at 2022-10-18 12:45:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-nbsmoke (Old)
 and      /work/SRC/openSUSE:Factory/.python-nbsmoke.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-nbsmoke"

Tue Oct 18 12:45:24 2022 rev:9 rq:1029607 version:0.6.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-nbsmoke/python-nbsmoke.changes    
2022-06-25 10:25:12.462754747 +0200
+++ /work/SRC/openSUSE:Factory/.python-nbsmoke.new.2275/python-nbsmoke.changes  
2022-10-18 12:45:49.109835560 +0200
@@ -1,0 +2,5 @@
+Mon Oct 17 20:15:23 UTC 2022 - Ben Greiner <c...@bnavigator.de>
+
+- Add nbsmoke-pr63-remove-id.patch -- gh#pyviz-dev/nbsmoke#63
+
+-------------------------------------------------------------------

New:
----
  nbsmoke-pr63-remove-id.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-nbsmoke.spec ++++++
--- /var/tmp/diff_new_pack.H4Oc3y/_old  2022-10-18 12:45:49.541836543 +0200
+++ /var/tmp/diff_new_pack.H4Oc3y/_new  2022-10-18 12:45:49.545836553 +0200
@@ -26,6 +26,8 @@
 Group:          Development/Languages/Python
 URL:            https://github.com/pyviz-dev/nbsmoke
 Source:         
https://files.pythonhosted.org/packages/source/n/nbsmoke/nbsmoke-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM nbsmoke-pr63-remove-id.patch gh#pyviz-dev/nbsmoke#63
+Patch0:         nbsmoke-pr63-remove-id.patch
 # PATCH-FIX-OPENSUSE nbsmoke-obs-nounraisableexception.patch, don't error on 
warnings about obs not closing sockets in time, c...@bnavigator.de
 Patch1:         nbsmoke-obs-nounraisableexception.patch
 BuildRequires:  %{python_module setuptools}

++++++ nbsmoke-pr63-remove-id.patch ++++++
>From 86860f1900bbc38f0a1873001bb8f420f66d96d4 Mon Sep 17 00:00:00 2001
From: maximlt <mliq...@anaconda.com>
Date: Mon, 3 Oct 2022 14:30:05 +0200
Subject: [PATCH 2/2] remove added id field when not required

---
 nbsmoke/lint/magics/__init__.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/nbsmoke/lint/magics/__init__.py b/nbsmoke/lint/magics/__init__.py
index 8e991e8..c23f2ab 100644
--- a/nbsmoke/lint/magics/__init__.py
+++ b/nbsmoke/lint/magics/__init__.py
@@ -120,11 +120,23 @@ def _load_user_magic_handlers(path):
     def insert_get_ipython(nb):
         # define and use get_ipython (for pyflakes)
         if len(nb['cells']) > 0:
+            is_id_field = 'id' in nb['cells'][0]
             # the get_ipython() is so pyflakes doesn't complain if no
             # magics present (which would leave get_ipython unused)
             get_ipython_cell = nbformat.v4.new_code_cell(
                 'from IPython import get_ipython\nget_ipython()')
             nb['cells'].insert(0,get_ipython_cell)
+            # Starting from nbformat 4.5 notebook cells must have an id field.
+            # So adding a new cell with new_code_cell will add a cell with an 
id field.
+            # However, if the notebook was based on a previous version (e.g. 
4.2),
+            # then it would contain a mix of id and non id cells. Newer 
versions
+            # of nbformat (5.6) raise an error when validating such notebook 
while
+            # before they were mutating it. nbconvert uses nbformat to validate
+            # it build proper notebooks, in particular after applying 
preprocessors.
+            # This change remove the id added by new_code_cell if the notebook
+            # didn't have ids (just checking the first cell...).
+            if 'id' in nb['cells'][0] and not is_id_field:
+                del nb['cells'][0]['id']
 
 
     def ipython_to_python_for_flake_checks(self, ipy):

Reply via email to