forked from pool/python-Sphinx
		
	Accepting request 1134224 from devel:languages:python
- Add upstream patch fix-autodoc-tests-python-3117.patch to make it work with python 3.11.7 gh#sphinx-doc/sphinx#11793 OBS-URL: https://build.opensuse.org/request/show/1134224 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-Sphinx?expand=0&rev=103
This commit is contained in:
		
							
								
								
									
										68
									
								
								fix-autodoc-tests-python-3117.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								fix-autodoc-tests-python-3117.patch
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,68 @@
 | 
			
		||||
Index: sphinx-7.2.6/tests/test_ext_autodoc_configs.py
 | 
			
		||||
===================================================================
 | 
			
		||||
--- sphinx-7.2.6.orig/tests/test_ext_autodoc_configs.py
 | 
			
		||||
+++ sphinx-7.2.6/tests/test_ext_autodoc_configs.py
 | 
			
		||||
@@ -1584,6 +1584,14 @@ def test_autodoc_typehints_format_fully_
 | 
			
		||||
 
 | 
			
		||||
 @pytest.mark.sphinx('html', testroot='ext-autodoc')
 | 
			
		||||
 def test_autodoc_default_options(app):
 | 
			
		||||
+    if (
 | 
			
		||||
+            (3, 11, 7) <= sys.version_info < (3, 12)
 | 
			
		||||
+            or sys.version_info >= (3, 12, 1)
 | 
			
		||||
+    ):
 | 
			
		||||
+        list_of_weak_references = "      list of weak references to the object"
 | 
			
		||||
+    else:
 | 
			
		||||
+        list_of_weak_references = "      list of weak references to the object (if defined)"
 | 
			
		||||
+
 | 
			
		||||
     # no settings
 | 
			
		||||
     actual = do_autodoc(app, 'class', 'target.enums.EnumCls')
 | 
			
		||||
     assert '   .. py:attribute:: EnumCls.val1' not in actual
 | 
			
		||||
@@ -1627,7 +1635,7 @@ def test_autodoc_default_options(app):
 | 
			
		||||
     assert '      Iterate squares of each value.' in actual
 | 
			
		||||
     if not IS_PYPY:
 | 
			
		||||
         assert '   .. py:attribute:: CustomIter.__weakref__' in actual
 | 
			
		||||
-        assert '      list of weak references to the object (if defined)' in actual
 | 
			
		||||
+        assert list_of_weak_references in actual
 | 
			
		||||
 
 | 
			
		||||
     # :exclude-members: None - has no effect. Unlike :members:,
 | 
			
		||||
     # :special-members:, etc. where None == "include all", here None means
 | 
			
		||||
@@ -1651,13 +1659,21 @@ def test_autodoc_default_options(app):
 | 
			
		||||
     assert '      Iterate squares of each value.' in actual
 | 
			
		||||
     if not IS_PYPY:
 | 
			
		||||
         assert '   .. py:attribute:: CustomIter.__weakref__' in actual
 | 
			
		||||
-        assert '      list of weak references to the object (if defined)' in actual
 | 
			
		||||
+        assert list_of_weak_references in actual
 | 
			
		||||
     assert '   .. py:method:: CustomIter.snafucate()' in actual
 | 
			
		||||
     assert '      Makes this snafucated.' in actual
 | 
			
		||||
 
 | 
			
		||||
 
 | 
			
		||||
 @pytest.mark.sphinx('html', testroot='ext-autodoc')
 | 
			
		||||
 def test_autodoc_default_options_with_values(app):
 | 
			
		||||
+    if (
 | 
			
		||||
+            (3, 11, 7) <= sys.version_info < (3, 12)
 | 
			
		||||
+            or sys.version_info >= (3, 12, 1)
 | 
			
		||||
+    ):
 | 
			
		||||
+        list_of_weak_references = "      list of weak references to the object"
 | 
			
		||||
+    else:
 | 
			
		||||
+        list_of_weak_references = "      list of weak references to the object (if defined)"
 | 
			
		||||
+
 | 
			
		||||
     # with :members:
 | 
			
		||||
     app.config.autodoc_default_options = {'members': 'val1,val2'}
 | 
			
		||||
     actual = do_autodoc(app, 'class', 'target.enums.EnumCls')
 | 
			
		||||
@@ -1698,7 +1714,7 @@ def test_autodoc_default_options_with_va
 | 
			
		||||
     assert '      Iterate squares of each value.' in actual
 | 
			
		||||
     if not IS_PYPY:
 | 
			
		||||
         assert '   .. py:attribute:: CustomIter.__weakref__' not in actual
 | 
			
		||||
-        assert '      list of weak references to the object (if defined)' not in actual
 | 
			
		||||
+        assert list_of_weak_references not in actual
 | 
			
		||||
 
 | 
			
		||||
     # with :exclude-members:
 | 
			
		||||
     app.config.autodoc_default_options = {
 | 
			
		||||
@@ -1722,6 +1738,6 @@ def test_autodoc_default_options_with_va
 | 
			
		||||
     assert '      Iterate squares of each value.' in actual
 | 
			
		||||
     if not IS_PYPY:
 | 
			
		||||
         assert '   .. py:attribute:: CustomIter.__weakref__' not in actual
 | 
			
		||||
-        assert '      list of weak references to the object (if defined)' not in actual
 | 
			
		||||
+        assert list_of_weak_references not in actual
 | 
			
		||||
     assert '   .. py:method:: CustomIter.snafucate()' not in actual
 | 
			
		||||
     assert '      Makes this snafucated.' not in actual
 | 
			
		||||
@@ -1,3 +1,9 @@
 | 
			
		||||
-------------------------------------------------------------------
 | 
			
		||||
Wed Dec 20 12:48:53 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
 | 
			
		||||
 | 
			
		||||
- Add upstream patch fix-autodoc-tests-python-3117.patch to make it
 | 
			
		||||
  work with python 3.11.7 gh#sphinx-doc/sphinx#11793
 | 
			
		||||
 | 
			
		||||
-------------------------------------------------------------------
 | 
			
		||||
Tue Dec  5 20:12:58 UTC 2023 - Dirk Müller <dmueller@suse.com>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -42,6 +42,8 @@ Source3:        requests.inv
 | 
			
		||||
Source4:        readthedocs.inv
 | 
			
		||||
Source5:        update-intersphinx.sh
 | 
			
		||||
Source99:       python-Sphinx.keyring
 | 
			
		||||
# PATCH-FIX-UPSTREAM: fix-autodoc-tests-python-3117.patch gh#sphinx-doc/sphinx#11793
 | 
			
		||||
Patch01:        fix-autodoc-tests-python-3117.patch
 | 
			
		||||
BuildRequires:  %{python_module base}
 | 
			
		||||
BuildRequires:  %{python_module flit-core}
 | 
			
		||||
BuildRequires:  %{python_module pip}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user