Add compatibility with Python 3.14
This commit is contained in:
parent
de4dafa39e
commit
1dedfd6334
3 changed files with 73 additions and 0 deletions
29
8962398b761c3d85a.patch
Normal file
29
8962398b761c3d85a.patch
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
From 8962398b761c3d85a7c74b6f789b3ffb127bde0c Mon Sep 17 00:00:00 2001
|
||||
From: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
|
||||
Date: Thu, 6 Mar 2025 16:03:44 +0000
|
||||
Subject: [PATCH] autosummary: Update test for Python 3.14.0a5+ (#13418)
|
||||
|
||||
`types.UnionType` and `typing.Union` have been merged.
|
||||
---
|
||||
tests/test_extensions/test_ext_autosummary.py | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tests/test_extensions/test_ext_autosummary.py b/tests/test_extensions/test_ext_autosummary.py
|
||||
index 35dc7d180ef..c807ddba3d1 100644
|
||||
--- a/tests/test_extensions/test_ext_autosummary.py
|
||||
+++ b/tests/test_extensions/test_ext_autosummary.py
|
||||
@@ -447,8 +447,12 @@ def test_autosummary_generate_content_for_module_imported_members(app):
|
||||
]
|
||||
assert context['functions'] == ['bar']
|
||||
assert context['all_functions'] == ['_quux', 'bar']
|
||||
- assert context['classes'] == ['Class', 'Foo']
|
||||
- assert context['all_classes'] == ['Class', 'Foo', '_Baz']
|
||||
+ if sys.version_info >= (3, 14, 0, 'alpha', 5):
|
||||
+ assert context['classes'] == ['Class', 'Foo', 'Union']
|
||||
+ assert context['all_classes'] == ['Class', 'Foo', 'Union', '_Baz']
|
||||
+ else:
|
||||
+ assert context['classes'] == ['Class', 'Foo']
|
||||
+ assert context['all_classes'] == ['Class', 'Foo', '_Baz']
|
||||
assert context['exceptions'] == ['Exc']
|
||||
assert context['all_exceptions'] == ['Exc', '_Exc']
|
||||
assert context['attributes'] == ['CONSTANT1', 'qux', 'quuz', 'non_imported_member']
|
||||
40
e01e42f5fc738815b.patch
Normal file
40
e01e42f5fc738815b.patch
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
From e01e42f5fc738815b8499c4ede30c6caf130f0a4 Mon Sep 17 00:00:00 2001
|
||||
From: Adam Turner <9087854+aa-turner@users.noreply.github.com>
|
||||
Date: Wed, 19 Mar 2025 20:11:35 +0000
|
||||
Subject: [PATCH] Fix ``INVALID_BUILTIN_CLASSES`` test for Python 3.14.0a6+
|
||||
|
||||
---
|
||||
tests/test_util/test_util_typing.py | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tests/test_util/test_util_typing.py b/tests/test_util/test_util_typing.py
|
||||
index 35ee240f7b8..8a561c378ed 100644
|
||||
--- a/tests/test_util/test_util_typing.py
|
||||
+++ b/tests/test_util/test_util_typing.py
|
||||
@@ -205,7 +205,7 @@ def test_is_invalid_builtin_class() -> None:
|
||||
zipfile.Path,
|
||||
zipfile.CompleteDirs,
|
||||
)
|
||||
- if sys.version_info[:2] >= (3, 13):
|
||||
+ if sys.version_info[:2] == (3, 13):
|
||||
invalid_types += (
|
||||
# pathlib
|
||||
Path,
|
||||
@@ -217,7 +217,7 @@ def test_is_invalid_builtin_class() -> None:
|
||||
)
|
||||
|
||||
invalid_names = {(cls.__module__, cls.__qualname__) for cls in invalid_types}
|
||||
- if sys.version_info[:2] < (3, 13):
|
||||
+ if sys.version_info[:2] != (3, 13):
|
||||
invalid_names |= {
|
||||
('pathlib._local', 'Path'),
|
||||
('pathlib._local', 'PosixPath'),
|
||||
@@ -231,7 +231,7 @@ def test_is_invalid_builtin_class() -> None:
|
||||
('zipfile._path', 'Path'),
|
||||
('zipfile._path', 'CompleteDirs'),
|
||||
}
|
||||
- assert _INVALID_BUILTIN_CLASSES.keys() == invalid_names
|
||||
+ assert set(_INVALID_BUILTIN_CLASSES) == invalid_names
|
||||
|
||||
|
||||
def test_restify_type_hints_containers():
|
||||
|
|
@ -54,6 +54,10 @@ Patch: sphinx-test_theming.patch
|
|||
# https://github.com/sphinx-doc/sphinx/pull/11747
|
||||
Patch: Make-the-first-party-extensions-optional.patch
|
||||
|
||||
# Compatibility with Python 3.14
|
||||
Patch: https://github.com/sphinx-doc/sphinx/commit/8962398b761c3d85a.patch
|
||||
Patch: https://github.com/sphinx-doc/sphinx/commit/e01e42f5fc738815b.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: make
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue