15
0

Accepting request 1306528 from devel:languages:python

- Add patch support-docutils-0.22.patch:
  * Support docutils 0.22 changes.

OBS-URL: https://build.opensuse.org/request/show/1306528
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-sphinx-jsonschema?expand=0&rev=6
This commit is contained in:
2025-09-23 14:06:44 +00:00
committed by Git OBS Bridge
3 changed files with 52 additions and 3 deletions

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Sep 19 02:35:43 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-docutils-0.22.patch:
* Support docutils 0.22 changes.
-------------------------------------------------------------------
Thu Jun 12 12:21:13 UTC 2025 - Markéta Machová <mmachova@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-sphinx-jsonschema
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,8 @@ License: GPL-3.0-only
URL: https://github.com/lnoor/sphinx-jsonschema
# Tarballs from pypi.org are missing license files
Source: https://github.com/lnoor/sphinx-jsonschema/archive/refs/tags/v.%{version}.tar.gz#/sphinx-jsonschema-%{version}.tar.gz
# PATCH-FIX-UPSTREAM gh#lnoor/sphinx-jsonschema#90
Patch0: support-docutils-0.22.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
@@ -48,7 +50,7 @@ BuildRequires: %{python_module requests}
Sphinx extension to display JSON Schema.
%prep
%setup -q -n sphinx-jsonschema-v.%{version}
%autosetup -p1 -n sphinx-jsonschema-v.%{version}
%build
%pyproject_wheel
@@ -66,6 +68,6 @@ Sphinx extension to display JSON Schema.
%doc README.rst
%license LICENSE
%{python_sitelib}/sphinx[-_]jsonschema
%{python_sitelib}/sphinx[-_]jsonschema-%{info_version}*-info
%{python_sitelib}/sphinx[-_]jsonschema-%{info_version}.dist-info
%changelog

View File

@@ -0,0 +1,41 @@
From d4acc575f2d2e5cb0055820758ad109548e1dd36 Mon Sep 17 00:00:00 2001
From: Steve Kowalik <steven@wedontsleep.org>
Date: Fri, 19 Sep 2025 12:33:13 +1000
Subject: [PATCH] Remove use of SafeString
docutils 0.22.1 removed the SafeString class, since it isn't required
with Python 3 any more. Replace both uses of it with plain str.
---
sphinx-jsonschema/__init__.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/sphinx-jsonschema/__init__.py b/sphinx-jsonschema/__init__.py
index b6875ea..ae46daa 100644
--- a/sphinx-jsonschema/__init__.py
+++ b/sphinx-jsonschema/__init__.py
@@ -27,7 +27,6 @@
from docutils.parsers.rst import Directive, DirectiveError
from docutils.parsers.rst import directives
from docutils.utils import SystemMessagePropagation
-from docutils.utils.error_reporting import SafeString
from .wide_format import WideFormat, NOESC
@@ -243,7 +242,7 @@ def get_json_data(self):
except Exception as error:
error = self.state_machine.reporter.error(
'"%s" directive encountered a the following error while parsing the data.\n %s'
- % (self.name, SafeString("".join(format_exception_only(type(error), error)))),
+ % (self.name, str("".join(format_exception_only(type(error), error)))),
nodes.literal_block(schema, schema), line=self.lineno)
raise SystemMessagePropagation(error)
@@ -253,7 +252,7 @@ def get_json_data(self):
except KeyError:
error = self.state_machine.reporter.error(
'"%s" directive encountered a KeyError when trying to resolve the pointer'
- ' in schema: %s' % (self.name, SafeString(pointer)),
+ ' in schema: %s' % (self.name, str(pointer)),
nodes.literal_block(schema, schema), line=self.lineno)
raise SystemMessagePropagation(error)