public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-sphinx] rawhide: Fix tests for Python 3.16 (and Python 3.15.1+, 3.14.8+)
@ 2026-11-04 17:16
0 siblings, 0 replies; only message in thread
From: @ 2026-11-04 17:16 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/python-sphinx
Branch : rawhide
Commit : 194ec6ab49d7496cfff940bc10a7efa52d8cedc1
Author : Miro Hrončok <miro@hroncok.cz>
Date : 2026-11-04T14:52:15+01:00
Stats : +108/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/python-sphinx/c/194ec6ab49d7496cfff940bc10a7efa52d8cedc1?branch=rawhide
Log:
Fix tests for Python 3.16 (and Python 3.15.1+, 3.14.8+)
---
diff --git a/378a332a8f.patch b/378a332a8f.patch
new file mode 100644
index 0000000..2244afe
--- /dev/null
+++ b/378a332a8f.patch
@@ -0,0 +1,104 @@
+From 378a332a8fb7cc608d51c17e3732e57ef3ab0543 Mon Sep 17 00:00:00 2001
+From: Adam Turner <9087854+aa-turner@users.noreply.github.com>
+Date: Mon, 19 Oct 2026 17:05:16 -0700
+Subject: [PATCH] Fix tests for Python 3.16 pre-releases
+
+---
+ sphinx/ext/autodoc/_dynamic/_member_finder.py | 14 +++++++-
+ .../test_ext_autodoc_autofunction.py | 35 +++++++++++++------
+ 2 files changed, 37 insertions(+), 12 deletions(-)
+
+diff --git a/sphinx/ext/autodoc/_dynamic/_member_finder.py b/sphinx/ext/autodoc/_dynamic/_member_finder.py
+index e9afbf9e9cd..0335cac50fd 100644
+--- a/sphinx/ext/autodoc/_dynamic/_member_finder.py
++++ b/sphinx/ext/autodoc/_dynamic/_member_finder.py
+@@ -2,6 +2,7 @@
+
+ import operator
+ import re
++import sys
+ from enum import Enum
+ from typing import TYPE_CHECKING, Literal, NewType, TypeVar
+
+@@ -285,9 +286,10 @@ def _get_members_to_document(
+ elif props.obj_type in {'class', 'exception'}:
+ # the members directly defined in the class
+ obj_dict = get_attr(props._obj, '__dict__', {})
++ obj_is_enum_class = isenumclass(props._obj)
+
+ # enum members
+- if isenumclass(props._obj):
++ if obj_is_enum_class:
+ for name, defining_class, value in _filter_enum_dict(
+ props._obj, get_attr, obj_dict
+ ):
+@@ -326,6 +328,16 @@ def _get_members_to_document(
+ if ismock(value):
+ value = undecorate(value)
+
++ # Do not reintroduce native Enum APIs excluded above.
++ # Python 3.16 exposes supported sunder names in dir().
++ if (
++ sys.version_info[:2] >= (3, 16)
++ and obj_is_enum_class
++ and name in Enum.__dict__
++ and _is_native_enum_api(value, name)
++ ):
++ continue
++
+ unmangled = unmangle(props._obj, name)
+ if (
+ unmangled
+diff --git a/tests/test_ext_autodoc/test_ext_autodoc_autofunction.py b/tests/test_ext_autodoc/test_ext_autodoc_autofunction.py
+index 485329ebb37..b70d954f980 100644
+--- a/tests/test_ext_autodoc/test_ext_autodoc_autofunction.py
++++ b/tests/test_ext_autodoc/test_ext_autodoc_autofunction.py
+@@ -6,6 +6,8 @@
+
+ from __future__ import annotations
+
++import sys
++
+ import pytest
+
+ from tests.test_ext_autodoc.autodoc_util import do_autodoc
+@@ -122,17 +124,28 @@ def test_singledispatch() -> None:
+
+
+ def test_cfunction() -> None:
+- actual = do_autodoc('function', 'time.asctime')
+- assert actual == [
+- '',
+- '.. py:function:: asctime([tuple]) -> string',
+- ' :module: time',
+- '',
+- " Convert a time tuple to a string, e.g. 'Sat Jun 06 16:26:11 1998'.",
+- ' When the time tuple is not present, current time as returned by localtime()',
+- ' is used.',
+- '',
+- ]
++ actual = do_autodoc('function', 'time.sleep')
++ if sys.version_info >= (3, 16):
++ assert actual == [
++ '',
++ '.. py:function:: sleep(seconds, /)',
++ ' :module: time',
++ '',
++ ' Delay execution for a given number of seconds.',
++ '',
++ ' The argument may be a floating-point number for subsecond precision.',
++ '',
++ ]
++ else:
++ assert actual == [
++ '',
++ '.. py:function:: sleep(seconds)',
++ ' :module: time',
++ '',
++ ' Delay execution for a given number of seconds. The argument may be',
++ ' a floating-point number for subsecond precision.',
++ '',
++ ]
+
+
+ def test_wrapped_function() -> None:
diff --git a/python-sphinx.spec b/python-sphinx.spec
index e656d49..43cb9bd 100644
--- a/python-sphinx.spec
+++ b/python-sphinx.spec
@@ -48,6 +48,10 @@ Patch: https://github.com/sphinx-doc/sphinx/pull/14474.patch
# the test used testroot='root' which lacks literalblock.txt
Patch: https://github.com/sphinx-doc/sphinx/pull/14507.patch
+# Fix tests for Python 3.16 (and Python 3.15.1+, 3.14.8+)
+# https://github.com/sphinx-doc/sphinx/commit/378a332a8f sans CHANGES.rst
+Patch: 378a332a8f.patch
+
# Make the first party extensions optional
# This removes the runtime dependencies on:
# - sphinxcontrib.applehelp
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-04 17:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 17:16 [rpms/python-sphinx] rawhide: Fix tests for Python 3.16 (and Python 3.15.1+, 3.14.8+)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox