forked from pool/python-python-jsonschema-objects
Accepting request 999455 from home:bnavigator:branches:devel:languages:python
- Add pso-markdown-version.patch * gh#cwacek/python-jsonschema-objects#230 OBS-URL: https://build.opensuse.org/request/show/999455 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-jsonschema-objects?expand=0&rev=9
This commit is contained in:
50
pso-markdown-version.patch
Normal file
50
pso-markdown-version.patch
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
From c38ada49dcbbf55789dcbcb3cd656640585322ee Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ben Greiner <code@bnavigator.de>
|
||||||
|
Date: Fri, 26 Aug 2022 19:17:37 +0200
|
||||||
|
Subject: [PATCH] Handle deprecated markdown version_info
|
||||||
|
|
||||||
|
---
|
||||||
|
python_jsonschema_objects/markdown_support.py | 14 +++++++-------
|
||||||
|
1 file changed, 7 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/python_jsonschema_objects/markdown_support.py b/python_jsonschema_objects/markdown_support.py
|
||||||
|
index bb2ea1b..235fdc0 100644
|
||||||
|
--- a/python_jsonschema_objects/markdown_support.py
|
||||||
|
+++ b/python_jsonschema_objects/markdown_support.py
|
||||||
|
@@ -4,6 +4,11 @@
|
||||||
|
import re
|
||||||
|
import json
|
||||||
|
|
||||||
|
+try:
|
||||||
|
+ from markdown import __version_info__ as markdown_version_info
|
||||||
|
+except ImportError:
|
||||||
|
+ from markdown import version_info as markdown_version_info
|
||||||
|
+
|
||||||
|
|
||||||
|
def extract_code_blocks(filename):
|
||||||
|
with open(filename) as fin:
|
||||||
|
@@ -14,14 +19,9 @@ def extract_code_blocks(filename):
|
||||||
|
preprocessors = M.preprocessors
|
||||||
|
tree_processors = M.treeprocessors
|
||||||
|
|
||||||
|
- try:
|
||||||
|
- version_info = markdown.__version_info__
|
||||||
|
- except AttributeError:
|
||||||
|
- version_info = markdown.version_info
|
||||||
|
-
|
||||||
|
# Markdown 3.* stores the processors in a class that can be iterated directly.
|
||||||
|
# Markdown 2.* stores them in a dict, so we have to pull out the values.
|
||||||
|
- if version_info[0] == 2:
|
||||||
|
+ if markdown_version_info[0] == 2:
|
||||||
|
# Note: `markdown.version_info` will be deprecated in favor of
|
||||||
|
# `markdown.__version_info__` in later versions of Markdown.
|
||||||
|
preprocessors = preprocessors.values()
|
||||||
|
@@ -45,7 +45,7 @@ def extendMarkdown(self, md, md_globals=None):
|
||||||
|
""" Add FencedBlockPreprocessor to the Markdown instance. """
|
||||||
|
md.registerExtension(self)
|
||||||
|
|
||||||
|
- if markdown.version_info[0] >= 3:
|
||||||
|
+ if markdown_version_info[0] >= 3:
|
||||||
|
md.preprocessors.register(
|
||||||
|
SpecialFencePreprocessor(md), "fenced_code_block", 10
|
||||||
|
)
|
@@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Aug 26 17:24:20 UTC 2022 - Ben Greiner <code@bnavigator.de>
|
||||||
|
|
||||||
|
- Add pso-markdown-version.patch
|
||||||
|
* gh#cwacek/python-jsonschema-objects#230
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Jul 8 04:30:39 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
|
Fri Jul 8 04:30:39 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
@@ -26,6 +26,8 @@ Summary: An object wrapper for JSON Schema definitions
|
|||||||
License: MIT
|
License: MIT
|
||||||
URL: https://python-jsonschema-objects.readthedocs.org/
|
URL: https://python-jsonschema-objects.readthedocs.org/
|
||||||
Source: https://files.pythonhosted.org/packages/source/p/python_jsonschema_objects/python_jsonschema_objects-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/p/python_jsonschema_objects/python_jsonschema_objects-%{version}.tar.gz
|
||||||
|
# PATCH-FIX-UPSTREAM pso-markdown-version.patch gh#cwacek/python-jsonschema-objects#230
|
||||||
|
Patch0: pso-markdown-version.patch
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
@@ -48,7 +50,7 @@ BuildRequires: %{python_module six >= 1.5.2}
|
|||||||
An object wrapper for JSON Schema definitions
|
An object wrapper for JSON Schema definitions
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n python_jsonschema_objects-%{version}
|
%autosetup -p1 -n python_jsonschema_objects-%{version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%python_build
|
||||||
|
Reference in New Issue
Block a user