15
0
forked from pool/python-Pweave

Accepting request 1011214 from devel:languages:python

- Skip failing test testFIR_FilterExampleTex (gh#mpastell/Pweave#168)
- Add markdown.patch to fix the tests

OBS-URL: https://build.opensuse.org/request/show/1011214
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-Pweave?expand=0&rev=8
This commit is contained in:
2022-10-16 14:09:18 +00:00
committed by Git OBS Bridge
3 changed files with 53 additions and 2 deletions

37
markdown.patch Normal file
View File

@@ -0,0 +1,37 @@
From d956f7d02105a4ae734a8713f5e10a956fbbe5c8 Mon Sep 17 00:00:00 2001
From: Dmitry Shachnev <mitya57@gmail.com>
Date: Mon, 18 Jul 2022 13:50:12 +0300
Subject: [PATCH] Adjust for API changes in Python-Markdown 3.0
Support for old deprecated API was removed in Python-Markdown 3.4.
---
pweave/formatters/markdownmath.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/pweave/formatters/markdownmath.py b/pweave/formatters/markdownmath.py
index 5a9c629..f665160 100644
--- a/pweave/formatters/markdownmath.py
+++ b/pweave/formatters/markdownmath.py
@@ -1,3 +1,4 @@
+from xml.etree.ElementTree import Element
import markdown
@@ -6,7 +7,7 @@ def __init__(self):
markdown.inlinepatterns.Pattern.__init__(self, r'(?<!\\)(\$\$?)(.+?)\2')
def handleMatch(self, m):
- node = markdown.util.etree.Element('span class="math"')
+ node = Element('span class="math"')
# node.text = markdown.util.AtomicString(m.group(2) + m.group(3) + m.group(2))
if m.group(2) == "$$":
node.text = markdown.util.AtomicString("\[" + m.group(3) + "\]")
@@ -17,5 +18,5 @@ def handleMatch(self, m):
class MathExtension(markdown.Extension):
- def extendMarkdown(self, md, md_globals):
- md.inlinePatterns.add('math', MathPattern(), '<escape')
\ No newline at end of file
+ def extendMarkdown(self, md):
+ md.inlinePatterns.register(MathPattern(), 'math', 185)

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Sat Oct 15 23:41:37 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Skip failing test testFIR_FilterExampleTex (gh#mpastell/Pweave#168)
-------------------------------------------------------------------
Thu Oct 6 14:02:25 UTC 2022 - Markéta Machová <mmachova@suse.com>
- Add markdown.patch to fix the tests
-------------------------------------------------------------------
Fri Feb 12 15:04:56 UTC 2021 - Dirk Müller <dmueller@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-Pweave
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -26,6 +26,8 @@ Summary: Scientific reports with embedded python computations
License: BSD-3-Clause
URL: https://github.com/mpastell/Pweave
Source: https://files.pythonhosted.org/packages/source/P/Pweave/Pweave-%{version}.tar.gz
# PATCH-FIX-UPSTREAM https://github.com/mpastell/Pweave/pull/167 Adjust for API changes in Python-Markdown 3.0
Patch0: markdown.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@@ -70,6 +72,7 @@ with e.g. Sphinx or rest2web.
%prep
%setup -q -n Pweave-%{version}
%autopatch -p1
%build
%python_build
@@ -97,7 +100,8 @@ with e.g. Sphinx or rest2web.
%check
# tests.test_readers.test_url - online
# Formatters/publish Layout changes with updates in jupyter
%pytest -k 'not (test_url or testFormatters or test_publish)'
# Failing test for testFIR_FilterExampleTex is gh#mpastell/Pweave#168
%pytest -k 'not (test_url or testFormatters or test_publish or testFIR_FilterExampleTex)'
%files %{python_files}
%doc CHANGELOG.txt README.rst