forked from pool/python-restructuredtext_lint
docutils >= 0.22 (gh#twolfson/restructuredtext-lint!64). - Add skip-failing-test-66.patch skipping failing test (gh#twolfson/restructuredtext-lint#66) fixing failing test test.test.TestRestructuredtextLintCLI.test_level_fail - Convert to pip-based build and libalternatives - Update to version 1.4.0 - Fixed non-zero exit code for missing files/directories. Fixes #58 - Update to version 1.3.2 - Added "Other tools" section to README. Replacement for #57 - Update to version 1.3.1 - Removed .pyc files from distribution. Fixes #56 - %python3_only -> %python_alternative - Removed no longer needed python37.patch - Update to v1.3.0 * Added Python 3.7 support - Remove unused dependency on PyYAML - Update to v1.2.2 * Dropped PyYAML dev dependency by simplifying one test case - Freshen python37.patch - Add patch to build with python 3.7: * python37.patch - Update to 1.2.1: * Added directory support via @dhruvsomani in #48. Fixes #38 - Remove superfluous devel dependency for noarch package - Update to 1.1.3 * Updated documentation and typos - spec file cleanups - Initial version OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-restructuredtext_lint?expand=0&rev=19
37 lines
1.8 KiB
Diff
37 lines
1.8 KiB
Diff
From feffa41fe2b0575754353913cd71df61e4eea0a6 Mon Sep 17 00:00:00 2001
|
|
From: Dominic Davis-Foster <dominic@davis-foster.co.uk>
|
|
Date: Thu, 14 Aug 2025 13:29:50 +0100
|
|
Subject: [PATCH] Set publusher components at instantiaion
|
|
|
|
---
|
|
restructuredtext_lint/lint.py | 9 +++++++--
|
|
1 file changed, 7 insertions(+), 2 deletions(-)
|
|
|
|
Index: restructuredtext_lint-1.4.0/restructuredtext_lint/lint.py
|
|
===================================================================
|
|
--- restructuredtext_lint-1.4.0.orig/restructuredtext_lint/lint.py 2018-11-14 06:55:13.000000000 +0100
|
|
+++ restructuredtext_lint-1.4.0/restructuredtext_lint/lint.py 2025-10-30 11:34:26.553577716 +0100
|
|
@@ -1,6 +1,7 @@
|
|
# Load in our dependencies
|
|
from __future__ import absolute_import
|
|
import io
|
|
+import docutils
|
|
from docutils import utils
|
|
from docutils.core import Publisher
|
|
from docutils.nodes import Element
|
|
@@ -18,8 +19,12 @@
|
|
# Generate a new parser (copying `rst2html.py` flow)
|
|
# http://repo.or.cz/w/docutils.git/blob/422cede485668203abc01c76ca317578ff634b30:/docutils/tools/rst2html.py
|
|
# http://repo.or.cz/w/docutils.git/blob/422cede485668203abc01c76ca317578ff634b30:/docutils/docutils/core.py#l348
|
|
- pub = Publisher(None, None, None, settings=None)
|
|
- pub.set_components('standalone', 'restructuredtext', 'pseudoxml')
|
|
+ # https://github.com/twolfson/restructuredtext-lint/pull/64
|
|
+ if docutils.__version_info__[:2] < (0, 22):
|
|
+ pub = Publisher(None, None, None, settings=None)
|
|
+ pub.set_components('standalone', 'restructuredtext', 'pseudoxml')
|
|
+ else:
|
|
+ pub = Publisher('standalone', 'restructuredtext', 'pseudoxml', settings=None)
|
|
|
|
# Configure publisher
|
|
# DEV: We cannot use `process_command_line` since it processes `sys.argv` which is for `rst-lint`, not `docutils`
|