File: docutils-0.22.patch

package info (click to toggle)
pydoctor 25.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,944 kB
  • sloc: python: 25,190; javascript: 2,561; ansic: 57; makefile: 25; sh: 24
file content (71 lines) | stat: -rw-r--r-- 2,905 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From: Dmitry Shachnev <mitya57@debian.org>
Date: Thu, 25 Sep 2025 22:13:55 +0300
Subject: Make the tests pass with Docutils 0.22 (#925)

Docutils now normalizes boolean values using str(int(value)):
https://sourceforge.net/p/docutils/code/9691/

(cherry picked from commit 3bb242ad531715717a220684f80b03d11c2aaac0)
---
 pydoctor/test/epydoc/test_epytext2node.py |  7 +++++--
 pydoctor/test/epydoc/test_pyval_repr.py   | 10 ++++++----
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/pydoctor/test/epydoc/test_epytext2node.py b/pydoctor/test/epydoc/test_epytext2node.py
index fbd0c9d..18c5b38 100644
--- a/pydoctor/test/epydoc/test_epytext2node.py
+++ b/pydoctor/test/epydoc/test_epytext2node.py
@@ -1,3 +1,5 @@
+import docutils
+
 from pydoctor.test.epydoc.test_epytext2html import epytext2node
 
 def test_nested_markup() -> None:
@@ -22,10 +24,11 @@ def test_nested_markup() -> None:
     doc = '''
         It becomes a little bit complicated with U{B{custom} links <https://google.ca>}
         '''
-    expected = '''<document source="epytext">
+    docutils_0_22 = docutils.__version_info__ >= (0, 22)
+    expected = f'''<document source="epytext">
     <paragraph>
         It becomes a little bit complicated with 
-        <reference internal="False" refuri="https://google.ca">
+        <reference internal="{0 if docutils_0_22 else False}" refuri="https://google.ca">
             <strong>
                 custom
              links
diff --git a/pydoctor/test/epydoc/test_pyval_repr.py b/pydoctor/test/epydoc/test_pyval_repr.py
index 23ba3d4..011ad1e 100644
--- a/pydoctor/test/epydoc/test_pyval_repr.py
+++ b/pydoctor/test/epydoc/test_pyval_repr.py
@@ -5,6 +5,7 @@ from textwrap import dedent
 from typing import Any, Union
 import xml.sax
 
+import docutils
 import pytest
 
 from pydoctor.epydoc.markup._pyval_repr import PyvalColorizer, colorize_inline_pyval
@@ -1563,16 +1564,17 @@ def test_expressions_parens(subtests:Any) -> None:
 
 def test_is_annotation_flag() -> None:
     # the is_annotation attribute is added to all links when is_annotation=True is passed.
-    assert color(extract_expr(ast.parse('list[dict] + set()')), is_annotation=True) == '''<document source="pyval_repr">
-    <obj_reference is_annotation="True" refuri="list">
+    docutils_0_22 = docutils.__version_info__ >= (0, 22)
+    assert color(extract_expr(ast.parse('list[dict] + set()')), is_annotation=True) == f'''<document source="pyval_repr">
+    <obj_reference is_annotation="{1 if docutils_0_22 else True}" refuri="list">
         list
     [
     <wbr>
-    <obj_reference is_annotation="True" refuri="dict">
+    <obj_reference is_annotation="{1 if docutils_0_22 else True}" refuri="dict">
         dict
     ]
      + 
-    <obj_reference is_annotation="True" refuri="set">
+    <obj_reference is_annotation="{1 if docutils_0_22 else True}" refuri="set">
         set
     (
     )