Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3fa5c435e1 | |||
| 386cb6e874 | |||
| e4c31fd612 | |||
| 59303ae9d8 | |||
| 4ac821f497 | |||
| b787bdf90d | |||
| 574c5a94d6 | |||
| d241286834 | |||
| 78fa545ec7 | |||
| 0009cf4a25 | |||
| 31b58a6666 | |||
| bd77693107 | |||
| 9db66313d0 | |||
| 9848821cbe | |||
| 8d9f71877e | |||
| 5e29644eb4 | |||
| 0522916ddc | |||
| aa73a643c5 | |||
| 600e566ce8 | |||
| 94392caedd | |||
| bdccc31518 | |||
| 1dedfd6334 | |||
| de4dafa39e | |||
| cca8be3e8b | |||
| c97bb0f3e2 | |||
| 383e230ab0 | |||
| f1121b8bac |
@@ -0,0 +1 @@
|
|||||||
|
1
|
||||||
@@ -47,3 +47,6 @@
|
|||||||
/sphinx-7.1.2.tar.gz
|
/sphinx-7.1.2.tar.gz
|
||||||
/sphinx-7.2.6.tar.gz
|
/sphinx-7.2.6.tar.gz
|
||||||
/sphinx-7.3.7.tar.gz
|
/sphinx-7.3.7.tar.gz
|
||||||
|
/sphinx-8.1.3.tar.gz
|
||||||
|
/sphinx-8.2.3.tar.gz
|
||||||
|
/sphinx-9.1.0.tar.gz
|
||||||
|
|||||||
-37
@@ -1,37 +0,0 @@
|
|||||||
From 12f63b3a0425841f2bdcda3f08e656453ea59297 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
|
|
||||||
Date: Wed, 8 May 2024 14:38:35 +0200
|
|
||||||
Subject: [PATCH] Move `defusedxml` import into the function using it
|
|
||||||
|
|
||||||
Import `defusedxml` inside the `etree_parse()` function rather than
|
|
||||||
in global scope of `sphinx.testing.util`. This makes it possible
|
|
||||||
for reverse dependencies (such as `breathe`) to use this module without
|
|
||||||
adding an unnecessary transitive dependency on `defusedxml` when it's
|
|
||||||
not actually used.
|
|
||||||
|
|
||||||
See also issue #12339.
|
|
||||||
---
|
|
||||||
sphinx/testing/util.py | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/sphinx/testing/util.py b/sphinx/testing/util.py
|
|
||||||
index d1de8ea2b74..b2df709eea8 100644
|
|
||||||
--- a/sphinx/testing/util.py
|
|
||||||
+++ b/sphinx/testing/util.py
|
|
||||||
@@ -11,7 +11,6 @@
|
|
||||||
from types import MappingProxyType
|
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
-from defusedxml.ElementTree import parse as xml_parse
|
|
||||||
from docutils import nodes
|
|
||||||
from docutils.parsers.rst import directives, roles
|
|
||||||
|
|
||||||
@@ -73,6 +72,8 @@ def assert_node(node: Node, cls: Any = None, xpath: str = "", **kwargs: Any) ->
|
|
||||||
# keep this to restrict the API usage and to have a correct return type
|
|
||||||
def etree_parse(path: str | os.PathLike[str]) -> ElementTree:
|
|
||||||
"""Parse a file into a (safe) XML element tree."""
|
|
||||||
+ from defusedxml.ElementTree import parse as xml_parse
|
|
||||||
+
|
|
||||||
return xml_parse(path)
|
|
||||||
|
|
||||||
|
|
||||||
-145
@@ -1,145 +0,0 @@
|
|||||||
From 14da0bb6073a1ec60432340035d17948b3adb22a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Chris Sewell <chrisj_sewell@hotmail.com>
|
|
||||||
Date: Wed, 15 May 2024 06:20:54 +0200
|
|
||||||
Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Fix=20python=203.13=20tests?=
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
---
|
|
||||||
tests/test_extensions/test_ext_autodoc.py | 2 +-
|
|
||||||
.../test_ext_autodoc_configs.py | 31 +++++++++++++------
|
|
||||||
2 files changed, 22 insertions(+), 11 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/tests/test_extensions/test_ext_autodoc.py b/tests/test_extensions/test_ext_autodoc.py
|
|
||||||
index a88d111bdb3..5a2e91cb5e9 100644
|
|
||||||
--- a/tests/test_extensions/test_ext_autodoc.py
|
|
||||||
+++ b/tests/test_extensions/test_ext_autodoc.py
|
|
||||||
@@ -838,7 +838,7 @@ def test_autodoc_special_members(app):
|
|
||||||
"special-members": None,
|
|
||||||
}
|
|
||||||
if sys.version_info >= (3, 13, 0, 'alpha', 5):
|
|
||||||
- options["exclude-members"] = "__static_attributes__"
|
|
||||||
+ options["exclude-members"] = "__static_attributes__,__firstlineno__"
|
|
||||||
actual = do_autodoc(app, 'class', 'target.Class', options)
|
|
||||||
assert list(filter(lambda l: '::' in l, actual)) == [
|
|
||||||
'.. py:class:: Class(arg)',
|
|
||||||
diff --git a/tests/test_extensions/test_ext_autodoc_configs.py b/tests/test_extensions/test_ext_autodoc_configs.py
|
|
||||||
index 6c2af5a0652..1262b15162b 100644
|
|
||||||
--- a/tests/test_extensions/test_ext_autodoc_configs.py
|
|
||||||
+++ b/tests/test_extensions/test_ext_autodoc_configs.py
|
|
||||||
@@ -679,6 +679,10 @@ def test_autodoc_typehints_signature(app):
|
|
||||||
type_o = "~typing.Any | None"
|
|
||||||
else:
|
|
||||||
type_o = "~typing.Any"
|
|
||||||
+ if sys.version_info[:2] >= (3, 13):
|
|
||||||
+ type_ppp = "pathlib._local.PurePosixPath"
|
|
||||||
+ else:
|
|
||||||
+ type_ppp = "pathlib.PurePosixPath"
|
|
||||||
|
|
||||||
options = {"members": None,
|
|
||||||
"undoc-members": None}
|
|
||||||
@@ -703,7 +707,7 @@ def test_autodoc_typehints_signature(app):
|
|
||||||
'',
|
|
||||||
'.. py:data:: CONST3',
|
|
||||||
' :module: target.typehints',
|
|
||||||
- ' :type: ~pathlib.PurePosixPath',
|
|
||||||
+ f' :type: ~{type_ppp}',
|
|
||||||
" :value: PurePosixPath('/a/b/c')",
|
|
||||||
'',
|
|
||||||
' docstring',
|
|
||||||
@@ -726,7 +730,7 @@ def test_autodoc_typehints_signature(app):
|
|
||||||
'',
|
|
||||||
' .. py:attribute:: Math.CONST3',
|
|
||||||
' :module: target.typehints',
|
|
||||||
- ' :type: ~pathlib.PurePosixPath',
|
|
||||||
+ f' :type: ~{type_ppp}',
|
|
||||||
" :value: PurePosixPath('/a/b/c')",
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
@@ -748,7 +752,7 @@ def test_autodoc_typehints_signature(app):
|
|
||||||
'',
|
|
||||||
' .. py:property:: Math.path',
|
|
||||||
' :module: target.typehints',
|
|
||||||
- ' :type: ~pathlib.PurePosixPath',
|
|
||||||
+ f' :type: ~{type_ppp}',
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
' .. py:property:: Math.prop',
|
|
||||||
@@ -773,7 +777,7 @@ def test_autodoc_typehints_signature(app):
|
|
||||||
'',
|
|
||||||
' docstring',
|
|
||||||
'',
|
|
||||||
- " alias of TypeVar('T', bound=\\ :py:class:`~pathlib.PurePosixPath`)",
|
|
||||||
+ f" alias of TypeVar('T', bound=\\ :py:class:`~{type_ppp}`)",
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
'.. py:function:: complex_func(arg1: str, arg2: List[int], arg3: Tuple[int, '
|
|
||||||
@@ -802,6 +806,10 @@ def test_autodoc_typehints_signature(app):
|
|
||||||
@pytest.mark.sphinx('html', testroot='ext-autodoc',
|
|
||||||
confoverrides={'autodoc_typehints': "none"})
|
|
||||||
def test_autodoc_typehints_none(app):
|
|
||||||
+ if sys.version_info[:2] >= (3, 13):
|
|
||||||
+ type_ppp = "pathlib._local.PurePosixPath"
|
|
||||||
+ else:
|
|
||||||
+ type_ppp = "pathlib.PurePosixPath"
|
|
||||||
options = {"members": None,
|
|
||||||
"undoc-members": None}
|
|
||||||
actual = do_autodoc(app, 'module', 'target.typehints', options)
|
|
||||||
@@ -887,7 +895,7 @@ def test_autodoc_typehints_none(app):
|
|
||||||
'',
|
|
||||||
' docstring',
|
|
||||||
'',
|
|
||||||
- " alias of TypeVar('T', bound=\\ :py:class:`~pathlib.PurePosixPath`)",
|
|
||||||
+ f" alias of TypeVar('T', bound=\\ :py:class:`~{type_ppp}`)",
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
'.. py:function:: complex_func(arg1, arg2, arg3=None, *args, **kwargs)',
|
|
||||||
@@ -1417,7 +1425,10 @@ def test_autodoc_typehints_format_fully_qualified(app):
|
|
||||||
type_o = "typing.Any | None"
|
|
||||||
else:
|
|
||||||
type_o = "typing.Any"
|
|
||||||
-
|
|
||||||
+ if sys.version_info[:2] >= (3, 13):
|
|
||||||
+ type_ppp = "pathlib._local.PurePosixPath"
|
|
||||||
+ else:
|
|
||||||
+ type_ppp = "pathlib.PurePosixPath"
|
|
||||||
options = {"members": None,
|
|
||||||
"undoc-members": None}
|
|
||||||
actual = do_autodoc(app, 'module', 'target.typehints', options)
|
|
||||||
@@ -1441,7 +1452,7 @@ def test_autodoc_typehints_format_fully_qualified(app):
|
|
||||||
'',
|
|
||||||
'.. py:data:: CONST3',
|
|
||||||
' :module: target.typehints',
|
|
||||||
- ' :type: pathlib.PurePosixPath',
|
|
||||||
+ f' :type: {type_ppp}',
|
|
||||||
" :value: PurePosixPath('/a/b/c')",
|
|
||||||
'',
|
|
||||||
' docstring',
|
|
||||||
@@ -1464,7 +1475,7 @@ def test_autodoc_typehints_format_fully_qualified(app):
|
|
||||||
'',
|
|
||||||
' .. py:attribute:: Math.CONST3',
|
|
||||||
' :module: target.typehints',
|
|
||||||
- ' :type: pathlib.PurePosixPath',
|
|
||||||
+ f' :type: {type_ppp}',
|
|
||||||
" :value: PurePosixPath('/a/b/c')",
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
@@ -1486,7 +1497,7 @@ def test_autodoc_typehints_format_fully_qualified(app):
|
|
||||||
'',
|
|
||||||
' .. py:property:: Math.path',
|
|
||||||
' :module: target.typehints',
|
|
||||||
- ' :type: pathlib.PurePosixPath',
|
|
||||||
+ f' :type: {type_ppp}',
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
' .. py:property:: Math.prop',
|
|
||||||
@@ -1511,7 +1522,7 @@ def test_autodoc_typehints_format_fully_qualified(app):
|
|
||||||
'',
|
|
||||||
' docstring',
|
|
||||||
'',
|
|
||||||
- " alias of TypeVar('T', bound=\\ :py:class:`pathlib.PurePosixPath`)",
|
|
||||||
+ f" alias of TypeVar('T', bound=\\ :py:class:`{type_ppp}`)",
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
'.. py:function:: complex_func(arg1: str, arg2: List[int], arg3: Tuple[int, '
|
|
||||||
@@ -1,58 +1,61 @@
|
|||||||
From b74128966fe4edf77a0c3a7936f6a6216833c9ed Mon Sep 17 00:00:00 2001
|
From 7b731f7ceb8161b11a529f182bf567b77993bdeb Mon Sep 17 00:00:00 2001
|
||||||
From: Karolina Surma <ksurma@redhat.com>
|
From: Karolina Surma <ksurma@redhat.com>
|
||||||
Date: Thu, 25 Apr 2024 15:58:03 +0200
|
Date: Wed, 5 Mar 2025 12:14:49 +0100
|
||||||
Subject: [PATCH] Make the first party extensions optional, add [extensions]
|
Subject: [PATCH] Make the first party extensions optional, add [extensions]
|
||||||
extra
|
extra
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
|
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
|
||||||
---
|
---
|
||||||
pyproject.toml | 33 ++++++++++++++++----
|
pyproject.toml | 35 ++++++++++++++++----
|
||||||
sphinx/application.py | 6 ++--
|
sphinx/application.py | 6 ++--
|
||||||
sphinx/registry.py | 9 ++++--
|
sphinx/registry.py | 10 +++---
|
||||||
sphinx/testing/fixtures.py | 7 +++++
|
sphinx/testing/fixtures.py | 7 ++++
|
||||||
tests/test_builders/test_build_html_maths.py | 3 ++
|
tests/test_builders/test_build_html_maths.py | 3 ++
|
||||||
tests/test_writers/test_api_translator.py | 2 ++
|
tests/test_writers/test_api_translator.py | 2 ++
|
||||||
6 files changed, 48 insertions(+), 12 deletions(-)
|
6 files changed, 50 insertions(+), 13 deletions(-)
|
||||||
|
|
||||||
diff --git a/pyproject.toml b/pyproject.toml
|
diff --git a/pyproject.toml b/pyproject.toml
|
||||||
index 8aa49aa..10fa20e 100644
|
index 1195b04..9a7213f 100644
|
||||||
--- a/pyproject.toml
|
--- a/pyproject.toml
|
||||||
+++ b/pyproject.toml
|
+++ b/pyproject.toml
|
||||||
@@ -56,12 +56,6 @@ classifiers = [
|
@@ -67,12 +67,6 @@ classifiers = [
|
||||||
"Topic :: Utilities",
|
"Typing :: Typed",
|
||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
- "sphinxcontrib-applehelp",
|
- "sphinxcontrib-applehelp>=1.0.7",
|
||||||
- "sphinxcontrib-devhelp",
|
- "sphinxcontrib-devhelp>=1.0.6",
|
||||||
- "sphinxcontrib-jsmath",
|
- "sphinxcontrib-htmlhelp>=2.0.6",
|
||||||
- "sphinxcontrib-htmlhelp>=2.0.0",
|
- "sphinxcontrib-jsmath>=1.0.1",
|
||||||
|
- "sphinxcontrib-qthelp>=1.0.6",
|
||||||
- "sphinxcontrib-serializinghtml>=1.1.9",
|
- "sphinxcontrib-serializinghtml>=1.1.9",
|
||||||
- "sphinxcontrib-qthelp",
|
"Jinja2>=3.1",
|
||||||
"Jinja2>=3.0",
|
"Pygments>=2.17",
|
||||||
"Pygments>=2.14",
|
"docutils>=0.21,<0.23",
|
||||||
"docutils>=0.18.1,<0.22",
|
@@ -87,6 +81,34 @@ dependencies = [
|
||||||
@@ -78,8 +72,35 @@ dependencies = [
|
]
|
||||||
dynamic = ["version"]
|
dynamic = ["version"]
|
||||||
|
|
||||||
[project.optional-dependencies]
|
+[project.optional-dependencies]
|
||||||
+applehelp = [
|
+applehelp = [
|
||||||
+ "sphinxcontrib-applehelp",
|
+ "sphinxcontrib-applehelp>=1.0.7",
|
||||||
+]
|
+]
|
||||||
+devhelp = [
|
+devhelp = [
|
||||||
+ "sphinxcontrib-devhelp",
|
+ "sphinxcontrib-devhelp>=1.0.6",
|
||||||
+]
|
+]
|
||||||
+jsmath = [
|
+jsmath = [
|
||||||
+ "sphinxcontrib-jsmath",
|
+ "sphinxcontrib-jsmath>=1.0.1",
|
||||||
+]
|
+]
|
||||||
+htmlhelp = [
|
+htmlhelp = [
|
||||||
+ "sphinxcontrib-htmlhelp>=2.0.0",
|
+ "sphinxcontrib-htmlhelp>=2.0.6",
|
||||||
+]
|
+]
|
||||||
+serializinghtml = [
|
+serializinghtml = [
|
||||||
+ "sphinxcontrib-serializinghtml>=1.1.9",
|
+ "sphinxcontrib-serializinghtml>=1.1.9",
|
||||||
+]
|
+]
|
||||||
+qthelp = [
|
+qthelp = [
|
||||||
+ "sphinxcontrib-qthelp",
|
+ "sphinxcontrib-qthelp>=1.0.6",
|
||||||
+]
|
+]
|
||||||
+extensions = [
|
+extensions = [
|
||||||
+ "sphinx[applehelp]",
|
+ "sphinx[applehelp]",
|
||||||
@@ -62,17 +65,23 @@ index 8aa49aa..10fa20e 100644
|
|||||||
+ "sphinx[serializinghtml]",
|
+ "sphinx[serializinghtml]",
|
||||||
+ "sphinx[qthelp]",
|
+ "sphinx[qthelp]",
|
||||||
+]
|
+]
|
||||||
|
+
|
||||||
|
[[project.authors]]
|
||||||
|
name = "Adam Turner"
|
||||||
|
email = "aa-turner@users.noreply.github.com"
|
||||||
|
@@ -104,6 +126,7 @@ sphinx-autogen = "sphinx.ext.autosummary.generate:main"
|
||||||
|
[dependency-groups]
|
||||||
docs = [
|
docs = [
|
||||||
"sphinxcontrib-websupport",
|
"sphinxcontrib-websupport",
|
||||||
+ "sphinx[extensions]",
|
+ "sphinx[extensions]",
|
||||||
]
|
]
|
||||||
lint = [
|
lint = [
|
||||||
"flake8>=3.5.0",
|
"ruff==0.14.9",
|
||||||
diff --git a/sphinx/application.py b/sphinx/application.py
|
diff --git a/sphinx/application.py b/sphinx/application.py
|
||||||
index 7d16d9a..2a71074 100644
|
index 5349c36..4da1635 100644
|
||||||
--- a/sphinx/application.py
|
--- a/sphinx/application.py
|
||||||
+++ b/sphinx/application.py
|
+++ b/sphinx/application.py
|
||||||
@@ -222,7 +222,7 @@ class Sphinx:
|
@@ -292,7 +292,7 @@ class Sphinx:
|
||||||
# load all built-in extension modules, first-party extension modules,
|
# load all built-in extension modules, first-party extension modules,
|
||||||
# and first-party themes
|
# and first-party themes
|
||||||
for extension in builtin_extensions:
|
for extension in builtin_extensions:
|
||||||
@@ -81,7 +90,7 @@ index 7d16d9a..2a71074 100644
|
|||||||
|
|
||||||
# load all user-given extension modules
|
# load all user-given extension modules
|
||||||
for extension in self.config.extensions:
|
for extension in self.config.extensions:
|
||||||
@@ -391,7 +391,7 @@ class Sphinx:
|
@@ -494,7 +494,7 @@ class Sphinx:
|
||||||
|
|
||||||
# ---- general extensibility interface -------------------------------------
|
# ---- general extensibility interface -------------------------------------
|
||||||
|
|
||||||
@@ -90,7 +99,7 @@ index 7d16d9a..2a71074 100644
|
|||||||
"""Import and setup a Sphinx extension module.
|
"""Import and setup a Sphinx extension module.
|
||||||
|
|
||||||
Load the extension given by the module *name*. Use this if your
|
Load the extension given by the module *name*. Use this if your
|
||||||
@@ -399,7 +399,7 @@ class Sphinx:
|
@@ -502,7 +502,7 @@ class Sphinx:
|
||||||
called twice.
|
called twice.
|
||||||
"""
|
"""
|
||||||
logger.debug('[app] setting up extension: %r', extname)
|
logger.debug('[app] setting up extension: %r', extname)
|
||||||
@@ -100,19 +109,19 @@ index 7d16d9a..2a71074 100644
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def require_sphinx(version: tuple[int, int] | str) -> None:
|
def require_sphinx(version: tuple[int, int] | str) -> None:
|
||||||
diff --git a/sphinx/registry.py b/sphinx/registry.py
|
diff --git a/sphinx/registry.py b/sphinx/registry.py
|
||||||
index 7887858..ca95960 100644
|
index da72924..b6f6122 100644
|
||||||
--- a/sphinx/registry.py
|
--- a/sphinx/registry.py
|
||||||
+++ b/sphinx/registry.py
|
+++ b/sphinx/registry.py
|
||||||
@@ -436,7 +436,7 @@ class SphinxComponentRegistry:
|
@@ -528,7 +528,7 @@ class SphinxComponentRegistry:
|
||||||
def add_html_theme(self, name: str, theme_path: str) -> None:
|
def add_html_theme(self, name: str, theme_path: str | os.PathLike[str]) -> None:
|
||||||
self.html_themes[name] = theme_path
|
self.html_themes[name] = _StrPath(theme_path)
|
||||||
|
|
||||||
- def load_extension(self, app: Sphinx, extname: str) -> None:
|
- def load_extension(self, app: Sphinx, extname: str) -> None:
|
||||||
+ def load_extension(self, app: Sphinx, extname: str, skip_nonimportable: bool = False) -> None:
|
+ def load_extension(self, app: Sphinx, extname: str, skip_nonimportable: bool = False) -> None:
|
||||||
"""Load a Sphinx extension."""
|
"""Load a Sphinx extension."""
|
||||||
if extname in app.extensions: # already loaded
|
if extname in app.extensions: # already loaded
|
||||||
return
|
return
|
||||||
@@ -452,9 +452,12 @@ class SphinxComponentRegistry:
|
@@ -549,10 +549,12 @@ class SphinxComponentRegistry:
|
||||||
try:
|
try:
|
||||||
mod = import_module(extname)
|
mod = import_module(extname)
|
||||||
except ImportError as err:
|
except ImportError as err:
|
||||||
@@ -121,26 +130,27 @@ index 7887858..ca95960 100644
|
|||||||
+ logger.debug(msg % extname)
|
+ logger.debug(msg % extname)
|
||||||
+ return
|
+ return
|
||||||
logger.verbose(__('Original exception:\n') + traceback.format_exc())
|
logger.verbose(__('Original exception:\n') + traceback.format_exc())
|
||||||
- raise ExtensionError(__('Could not import extension %s') % extname,
|
- raise ExtensionError(
|
||||||
- err) from err
|
- __('Could not import extension %s') % extname, err
|
||||||
|
- ) from err
|
||||||
+ raise ExtensionError(msg % extname, err) from err
|
+ raise ExtensionError(msg % extname, err) from err
|
||||||
|
|
||||||
setup: _ExtensionSetupFunc | None = getattr(mod, 'setup', None)
|
setup: _ExtensionSetupFunc | None = getattr(mod, 'setup', None)
|
||||||
if setup is None:
|
if setup is None:
|
||||||
diff --git a/sphinx/testing/fixtures.py b/sphinx/testing/fixtures.py
|
diff --git a/sphinx/testing/fixtures.py b/sphinx/testing/fixtures.py
|
||||||
index 6e1a122..f3fe743 100644
|
index c6fdebe..e9f98a8 100644
|
||||||
--- a/sphinx/testing/fixtures.py
|
--- a/sphinx/testing/fixtures.py
|
||||||
+++ b/sphinx/testing/fixtures.py
|
+++ b/sphinx/testing/fixtures.py
|
||||||
@@ -31,6 +31,7 @@ DEFAULT_ENABLED_MARKERS = [
|
@@ -31,6 +31,7 @@ DEFAULT_ENABLED_MARKERS = [
|
||||||
'keep_going=False, builddir=None, docutils_conf=None'
|
'builddir=None, docutils_conf=None'
|
||||||
'): arguments to initialize the sphinx test application.'
|
'): arguments to initialize the sphinx test application.'
|
||||||
),
|
),
|
||||||
+ 'sphinxcontrib(...): required sphinxcontrib.* extensions',
|
+ 'sphinxcontrib(...): required sphinxcontrib.* extensions',
|
||||||
'test_params(shared_result=...): test parameters.',
|
'test_params(shared_result=...): test parameters.',
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -80,6 +81,12 @@ def app_params(
|
@@ -79,6 +80,12 @@ def app_params(
|
||||||
Parameters that are specified by 'pytest.mark.sphinx' for
|
"""Parameters that are specified by 'pytest.mark.sphinx' for
|
||||||
sphinx.application.Sphinx initialization
|
sphinx.application.Sphinx initialization
|
||||||
"""
|
"""
|
||||||
+
|
+
|
||||||
@@ -153,53 +163,53 @@ index 6e1a122..f3fe743 100644
|
|||||||
|
|
||||||
pargs: dict[int, Any] = {}
|
pargs: dict[int, Any] = {}
|
||||||
diff --git a/tests/test_builders/test_build_html_maths.py b/tests/test_builders/test_build_html_maths.py
|
diff --git a/tests/test_builders/test_build_html_maths.py b/tests/test_builders/test_build_html_maths.py
|
||||||
index 900846b..664c86e 100644
|
index 8654ca9..8ad006f 100644
|
||||||
--- a/tests/test_builders/test_build_html_maths.py
|
--- a/tests/test_builders/test_build_html_maths.py
|
||||||
+++ b/tests/test_builders/test_build_html_maths.py
|
+++ b/tests/test_builders/test_build_html_maths.py
|
||||||
@@ -20,6 +20,7 @@ def test_html_math_renderer_is_imgmath(app, status, warning):
|
@@ -40,6 +40,7 @@ def test_html_math_renderer_is_imgmath(app: SphinxTestApp) -> None:
|
||||||
assert app.builder.math_renderer_name == 'imgmath'
|
assert app.builder.math_renderer_name == 'imgmath'
|
||||||
|
|
||||||
|
|
||||||
+@pytest.mark.sphinxcontrib('serializinghtml', 'jsmath')
|
+@pytest.mark.sphinxcontrib('serializinghtml', 'jsmath')
|
||||||
@pytest.mark.sphinx('html', testroot='basic',
|
@pytest.mark.sphinx(
|
||||||
confoverrides={'extensions': ['sphinxcontrib.jsmath',
|
'html',
|
||||||
'sphinx.ext.imgmath']})
|
testroot='basic',
|
||||||
@@ -40,6 +41,7 @@ def test_html_math_renderer_is_duplicated2(app, status, warning):
|
@@ -67,6 +68,7 @@ def test_html_math_renderer_is_duplicated2(app: SphinxTestApp) -> None:
|
||||||
assert app.builder.math_renderer_name == 'imgmath' # The another one is chosen
|
assert app.builder.math_renderer_name == 'imgmath' # The another one is chosen
|
||||||
|
|
||||||
|
|
||||||
+@pytest.mark.sphinxcontrib('jsmath')
|
+@pytest.mark.sphinxcontrib('jsmath')
|
||||||
@pytest.mark.sphinx('html', testroot='basic',
|
@pytest.mark.sphinx(
|
||||||
confoverrides={'extensions': ['sphinxcontrib.jsmath',
|
'html',
|
||||||
'sphinx.ext.imgmath'],
|
testroot='basic',
|
||||||
@@ -48,6 +50,7 @@ def test_html_math_renderer_is_chosen(app, status, warning):
|
@@ -80,6 +82,7 @@ def test_html_math_renderer_is_chosen(app: SphinxTestApp) -> None:
|
||||||
assert app.builder.math_renderer_name == 'imgmath'
|
assert app.builder.math_renderer_name == 'imgmath'
|
||||||
|
|
||||||
|
|
||||||
+@pytest.mark.sphinxcontrib('jsmath')
|
+@pytest.mark.sphinxcontrib('jsmath')
|
||||||
@pytest.mark.sphinx('html', testroot='basic',
|
@pytest.mark.sphinx(
|
||||||
confoverrides={'extensions': ['sphinxcontrib.jsmath',
|
'html',
|
||||||
'sphinx.ext.mathjax'],
|
testroot='basic',
|
||||||
diff --git a/tests/test_writers/test_api_translator.py b/tests/test_writers/test_api_translator.py
|
diff --git a/tests/test_writers/test_api_translator.py b/tests/test_writers/test_api_translator.py
|
||||||
index 9f2bd44..81575b7 100644
|
index 1220192..8e8bb33 100644
|
||||||
--- a/tests/test_writers/test_api_translator.py
|
--- a/tests/test_writers/test_api_translator.py
|
||||||
+++ b/tests/test_writers/test_api_translator.py
|
+++ b/tests/test_writers/test_api_translator.py
|
||||||
@@ -36,6 +36,7 @@ def test_singlehtml_set_translator_for_singlehtml(app, status, warning):
|
@@ -47,6 +47,7 @@ def test_singlehtml_set_translator_for_singlehtml(app: SphinxTestApp) -> None:
|
||||||
assert translator_class.__name__ == 'ConfSingleHTMLTranslator'
|
assert translator_class.__name__ == 'ConfSingleHTMLTranslator'
|
||||||
|
|
||||||
|
|
||||||
+@pytest.mark.sphinxcontrib('serializinghtml')
|
+@pytest.mark.sphinxcontrib('serializinghtml')
|
||||||
@pytest.mark.sphinx('pickle', testroot='api-set-translator')
|
@pytest.mark.sphinx('pickle', testroot='api-set-translator')
|
||||||
def test_pickle_set_translator_for_pickle(app, status, warning):
|
def test_pickle_set_translator_for_pickle(app: SphinxTestApp) -> None:
|
||||||
translator_class = app.builder.get_translator_class()
|
translator_class = app.builder.get_translator_class()
|
||||||
@@ -43,6 +44,7 @@ def test_pickle_set_translator_for_pickle(app, status, warning):
|
@@ -54,6 +55,7 @@ def test_pickle_set_translator_for_pickle(app: SphinxTestApp) -> None:
|
||||||
assert translator_class.__name__ == 'ConfPickleTranslator'
|
assert translator_class.__name__ == 'ConfPickleTranslator'
|
||||||
|
|
||||||
|
|
||||||
+@pytest.mark.sphinxcontrib('serializinghtml')
|
+@pytest.mark.sphinxcontrib('serializinghtml')
|
||||||
@pytest.mark.sphinx('json', testroot='api-set-translator')
|
@pytest.mark.sphinx('json', testroot='api-set-translator')
|
||||||
def test_json_set_translator_for_json(app, status, warning):
|
def test_json_set_translator_for_json(app: SphinxTestApp) -> None:
|
||||||
translator_class = app.builder.get_translator_class()
|
translator_class = app.builder.get_translator_class()
|
||||||
--
|
--
|
||||||
2.44.0
|
2.52.0
|
||||||
|
|
||||||
|
|||||||
+144
-22
@@ -2,6 +2,8 @@
|
|||||||
# Without the packages, we have warnings in docs, but it's not a hard dependency
|
# Without the packages, we have warnings in docs, but it's not a hard dependency
|
||||||
# We don't want to support sphinxcontrib-* in RHEL, hence disabling the dependencies
|
# We don't want to support sphinxcontrib-* in RHEL, hence disabling the dependencies
|
||||||
%bcond sphinxcontrib %{undefined rhel}
|
%bcond sphinxcontrib %{undefined rhel}
|
||||||
|
# RHEL does not include python3-snowballstemmer (SRPM: snowball)
|
||||||
|
%bcond snowballstemmer %{undefined rhel}
|
||||||
# Also, we don't have all the tests requirements
|
# Also, we don't have all the tests requirements
|
||||||
%bcond tests 1
|
%bcond tests 1
|
||||||
|
|
||||||
@@ -16,10 +18,11 @@
|
|||||||
%bcond imagemagick_tests %{undefined rhel}
|
%bcond imagemagick_tests %{undefined rhel}
|
||||||
|
|
||||||
# During texlive updates, sometimes the latex environment is unstable
|
# During texlive updates, sometimes the latex environment is unstable
|
||||||
|
# NOTE: LaTeX tests are never run when building for ELN.
|
||||||
%bcond latex_tests 1
|
%bcond latex_tests 1
|
||||||
|
|
||||||
Name: python-sphinx
|
Name: python-sphinx
|
||||||
%global general_version 7.3.7
|
%global general_version 9.1.0
|
||||||
#global prerel ...
|
#global prerel ...
|
||||||
%global upstream_version %{general_version}%{?prerel}
|
%global upstream_version %{general_version}%{?prerel}
|
||||||
Version: %{general_version}%{?prerel:~%{prerel}}
|
Version: %{general_version}%{?prerel:~%{prerel}}
|
||||||
@@ -54,12 +57,6 @@ Patch: sphinx-test_theming.patch
|
|||||||
# https://github.com/sphinx-doc/sphinx/pull/11747
|
# https://github.com/sphinx-doc/sphinx/pull/11747
|
||||||
Patch: Make-the-first-party-extensions-optional.patch
|
Patch: Make-the-first-party-extensions-optional.patch
|
||||||
|
|
||||||
# Fix tests with Python 3.13+
|
|
||||||
Patch: https://github.com/sphinx-doc/sphinx/pull/12373.patch
|
|
||||||
|
|
||||||
# Lazily import defusedxml only when necessary
|
|
||||||
Patch: https://github.com/sphinx-doc/sphinx/pull/12362.patch
|
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
@@ -88,36 +85,67 @@ BuildRequires: texinfo
|
|||||||
BuildRequires: ImageMagick
|
BuildRequires: ImageMagick
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with latex_tests}
|
%if %{undefined rhel} && %{with latex_tests}
|
||||||
BuildRequires: texlive-collection-fontsrecommended
|
BuildRequires: texlive-collection-fontsrecommended
|
||||||
BuildRequires: texlive-collection-latex
|
BuildRequires: texlive-collection-latex
|
||||||
|
BuildRequires: texlive-gnu-freefont
|
||||||
|
BuildRequires: latexmk
|
||||||
BuildRequires: texlive-dvipng
|
BuildRequires: texlive-dvipng
|
||||||
BuildRequires: texlive-dvisvgm
|
BuildRequires: texlive-dvisvgm
|
||||||
|
BuildRequires: tex(article.cls)
|
||||||
|
BuildRequires: tex(utf8x.def)
|
||||||
|
# Other dependencies.
|
||||||
|
BuildRequires: tex(alltt.sty)
|
||||||
|
BuildRequires: tex(amsfonts.sty)
|
||||||
BuildRequires: tex(amsmath.sty)
|
BuildRequires: tex(amsmath.sty)
|
||||||
|
BuildRequires: tex(amssymb.sty)
|
||||||
|
BuildRequires: tex(amstext.sty)
|
||||||
BuildRequires: tex(amsthm.sty)
|
BuildRequires: tex(amsthm.sty)
|
||||||
BuildRequires: tex(anyfontsize.sty)
|
BuildRequires: tex(anyfontsize.sty)
|
||||||
BuildRequires: tex(article.cls)
|
BuildRequires: tex(atbegshi.sty)
|
||||||
|
BuildRequires: tex(babel.sty)
|
||||||
|
BuildRequires: tex(bm.sty)
|
||||||
|
BuildRequires: tex(booktabs.sty)
|
||||||
BuildRequires: tex(capt-of.sty)
|
BuildRequires: tex(capt-of.sty)
|
||||||
BuildRequires: tex(cmap.sty)
|
BuildRequires: tex(cmap.sty)
|
||||||
BuildRequires: tex(color.sty)
|
BuildRequires: tex(colortbl.sty)
|
||||||
BuildRequires: tex(ctablestack.sty)
|
BuildRequires: tex(ellipse.sty)
|
||||||
|
BuildRequires: tex(etoolbox.sty)
|
||||||
BuildRequires: tex(fancyhdr.sty)
|
BuildRequires: tex(fancyhdr.sty)
|
||||||
BuildRequires: tex(fancyvrb.sty)
|
BuildRequires: tex(fancyvrb.sty)
|
||||||
|
BuildRequires: tex(float.sty)
|
||||||
BuildRequires: tex(fncychap.sty)
|
BuildRequires: tex(fncychap.sty)
|
||||||
|
BuildRequires: tex(fontawesome.sty)
|
||||||
|
BuildRequires: tex(fontawesome5.sty)
|
||||||
|
BuildRequires: tex(fontenc.sty)
|
||||||
|
BuildRequires: tex(fontspec.sty)
|
||||||
BuildRequires: tex(framed.sty)
|
BuildRequires: tex(framed.sty)
|
||||||
BuildRequires: tex(FreeSerif.otf)
|
|
||||||
BuildRequires: tex(geometry.sty)
|
BuildRequires: tex(geometry.sty)
|
||||||
|
BuildRequires: tex(graphicx.sty)
|
||||||
|
BuildRequires: tex(hypcap.sty)
|
||||||
BuildRequires: tex(hyperref.sty)
|
BuildRequires: tex(hyperref.sty)
|
||||||
|
BuildRequires: tex(inputenc.sty)
|
||||||
BuildRequires: tex(kvoptions.sty)
|
BuildRequires: tex(kvoptions.sty)
|
||||||
|
BuildRequires: tex(longtable.sty)
|
||||||
|
BuildRequires: tex(ltxcmds.sty)
|
||||||
BuildRequires: tex(luatex85.sty)
|
BuildRequires: tex(luatex85.sty)
|
||||||
|
BuildRequires: tex(makeidx.sty)
|
||||||
|
BuildRequires: tex(multicol.sty)
|
||||||
BuildRequires: tex(needspace.sty)
|
BuildRequires: tex(needspace.sty)
|
||||||
BuildRequires: tex(parskip.sty)
|
BuildRequires: tex(parskip.sty)
|
||||||
|
BuildRequires: tex(pict2e.sty)
|
||||||
BuildRequires: tex(polyglossia.sty)
|
BuildRequires: tex(polyglossia.sty)
|
||||||
|
BuildRequires: tex(remreset.sty)
|
||||||
BuildRequires: tex(tabulary.sty)
|
BuildRequires: tex(tabulary.sty)
|
||||||
|
BuildRequires: tex(textalpha.sty)
|
||||||
|
BuildRequires: tex(textcomp.sty)
|
||||||
|
BuildRequires: tex(tgheros.sty)
|
||||||
|
BuildRequires: tex(tgtermes.sty)
|
||||||
BuildRequires: tex(titlesec.sty)
|
BuildRequires: tex(titlesec.sty)
|
||||||
BuildRequires: tex(upquote.sty)
|
BuildRequires: tex(upquote.sty)
|
||||||
BuildRequires: tex(utf8x.def)
|
BuildRequires: tex(varwidth.sty)
|
||||||
BuildRequires: tex(wrapfig.sty)
|
BuildRequires: tex(wrapfig.sty)
|
||||||
|
BuildRequires: tex(xcolor.sty)
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@@ -156,6 +184,7 @@ Summary: Python documentation generator
|
|||||||
|
|
||||||
Recommends: graphviz
|
Recommends: graphviz
|
||||||
Recommends: ImageMagick
|
Recommends: ImageMagick
|
||||||
|
Recommends: make
|
||||||
|
|
||||||
# Upstream Requires those, but we have a patch to remove the dependency.
|
# Upstream Requires those, but we have a patch to remove the dependency.
|
||||||
# We keep them Recommended to preserve the default user experience.
|
# We keep them Recommended to preserve the default user experience.
|
||||||
@@ -196,39 +225,92 @@ the Python docs:
|
|||||||
snippets and inclusion of appropriately formatted docstrings.
|
snippets and inclusion of appropriately formatted docstrings.
|
||||||
|
|
||||||
|
|
||||||
|
%if %{undefined rhel}
|
||||||
%package -n python%{python3_pkgversion}-sphinx-latex
|
%package -n python%{python3_pkgversion}-sphinx-latex
|
||||||
Summary: LaTeX builder dependencies for python%{python3_pkgversion}-sphinx
|
Summary: LaTeX builder dependencies for python%{python3_pkgversion}-sphinx
|
||||||
|
|
||||||
Requires: python%{python3_pkgversion}-sphinx = %{epoch}:%{version}-%{release}
|
Requires: python%{python3_pkgversion}-sphinx = %{epoch}:%{version}-%{release}
|
||||||
|
# Required dependencies as stated in the documentation [1]:
|
||||||
|
#
|
||||||
|
# - texlive-collection-latexrecommended
|
||||||
|
# - texlive-collection-fontsrecommended
|
||||||
|
# - texlive-collection-fontsextra
|
||||||
|
# - texlive-collection-latexextra
|
||||||
|
# - texlive-tex-gyre
|
||||||
|
# - latexmk
|
||||||
|
#
|
||||||
|
# [1] https://www.sphinx-doc.org/en/master/usage/builders/index.html#sphinx.builders.latex.LaTeXBuilder
|
||||||
|
#
|
||||||
|
# These packages install 2500+ other packages requiring ~3 GiB of space.
|
||||||
|
# Therefore, a more precise list of dependencies.
|
||||||
|
|
||||||
Requires: texlive-collection-fontsrecommended
|
Requires: texlive-collection-fontsrecommended
|
||||||
Requires: texlive-collection-latex
|
Requires: texlive-collection-latex
|
||||||
|
Requires: texlive-gnu-freefont
|
||||||
|
Requires: latexmk
|
||||||
|
|
||||||
|
# Required by sphinx.ext.imgmath – Render math as images
|
||||||
Requires: texlive-dvipng
|
Requires: texlive-dvipng
|
||||||
Requires: texlive-dvisvgm
|
Requires: texlive-dvisvgm
|
||||||
|
#Requires: tex(preview.sty) Pulls in texlive-collection-latexrecommended
|
||||||
|
|
||||||
|
Requires: tex(article.cls)
|
||||||
|
Requires: tex(utf8x.def)
|
||||||
|
|
||||||
|
# Other dependencies.
|
||||||
|
# -- After searching for \RequirePackage{..} and \usepackage{..}.
|
||||||
|
Requires: tex(alltt.sty)
|
||||||
|
Requires: tex(amsfonts.sty)
|
||||||
Requires: tex(amsmath.sty)
|
Requires: tex(amsmath.sty)
|
||||||
|
Requires: tex(amssymb.sty)
|
||||||
|
Requires: tex(amstext.sty)
|
||||||
Requires: tex(amsthm.sty)
|
Requires: tex(amsthm.sty)
|
||||||
Requires: tex(anyfontsize.sty)
|
Requires: tex(anyfontsize.sty)
|
||||||
Requires: tex(article.cls)
|
Requires: tex(atbegshi.sty)
|
||||||
|
Requires: tex(babel.sty)
|
||||||
|
Requires: tex(bm.sty)
|
||||||
|
Requires: tex(booktabs.sty)
|
||||||
Requires: tex(capt-of.sty)
|
Requires: tex(capt-of.sty)
|
||||||
Requires: tex(cmap.sty)
|
Requires: tex(cmap.sty)
|
||||||
Requires: tex(color.sty)
|
Requires: tex(colortbl.sty)
|
||||||
Requires: tex(ctablestack.sty)
|
Requires: tex(ellipse.sty)
|
||||||
|
Requires: tex(etoolbox.sty)
|
||||||
Requires: tex(fancyhdr.sty)
|
Requires: tex(fancyhdr.sty)
|
||||||
Requires: tex(fancyvrb.sty)
|
Requires: tex(fancyvrb.sty)
|
||||||
|
Requires: tex(float.sty)
|
||||||
Requires: tex(fncychap.sty)
|
Requires: tex(fncychap.sty)
|
||||||
|
Requires: tex(fontawesome.sty)
|
||||||
|
Requires: tex(fontawesome5.sty)
|
||||||
|
Requires: tex(fontenc.sty)
|
||||||
|
Requires: tex(fontspec.sty)
|
||||||
Requires: tex(framed.sty)
|
Requires: tex(framed.sty)
|
||||||
Requires: tex(FreeSerif.otf)
|
|
||||||
Requires: tex(geometry.sty)
|
Requires: tex(geometry.sty)
|
||||||
|
Requires: tex(graphicx.sty)
|
||||||
|
Requires: tex(hypcap.sty)
|
||||||
Requires: tex(hyperref.sty)
|
Requires: tex(hyperref.sty)
|
||||||
|
Requires: tex(inputenc.sty)
|
||||||
Requires: tex(kvoptions.sty)
|
Requires: tex(kvoptions.sty)
|
||||||
|
Requires: tex(longtable.sty)
|
||||||
|
Requires: tex(ltxcmds.sty)
|
||||||
Requires: tex(luatex85.sty)
|
Requires: tex(luatex85.sty)
|
||||||
|
Requires: tex(makeidx.sty)
|
||||||
|
Requires: tex(multicol.sty)
|
||||||
Requires: tex(needspace.sty)
|
Requires: tex(needspace.sty)
|
||||||
Requires: tex(parskip.sty)
|
Requires: tex(parskip.sty)
|
||||||
|
Requires: tex(pict2e.sty)
|
||||||
Requires: tex(polyglossia.sty)
|
Requires: tex(polyglossia.sty)
|
||||||
|
Requires: tex(remreset.sty)
|
||||||
Requires: tex(tabulary.sty)
|
Requires: tex(tabulary.sty)
|
||||||
|
Requires: tex(textalpha.sty)
|
||||||
|
Requires: tex(textcomp.sty)
|
||||||
|
Requires: tex(tgheros.sty)
|
||||||
|
Requires: tex(tgtermes.sty)
|
||||||
Requires: tex(titlesec.sty)
|
Requires: tex(titlesec.sty)
|
||||||
Requires: tex(upquote.sty)
|
Requires: tex(upquote.sty)
|
||||||
Requires: tex(utf8x.def)
|
Requires: tex(varwidth.sty)
|
||||||
Requires: tex(wrapfig.sty)
|
Requires: tex(wrapfig.sty)
|
||||||
|
Requires: tex(xcolor.sty)
|
||||||
|
#Requires: tex(xeCJK.sty) Pulls in pLaTeX and upLaTeX
|
||||||
|
|
||||||
# No files in this package, automatic provides don't work:
|
# No files in this package, automatic provides don't work:
|
||||||
%py_provides python%{python3_pkgversion}-sphinx-latex
|
%py_provides python%{python3_pkgversion}-sphinx-latex
|
||||||
@@ -243,6 +325,7 @@ useful to many other projects.
|
|||||||
|
|
||||||
This package pulls in the TeX dependencies needed by Sphinx's LaTeX
|
This package pulls in the TeX dependencies needed by Sphinx's LaTeX
|
||||||
builder.
|
builder.
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%package doc
|
%package doc
|
||||||
@@ -264,13 +347,44 @@ This package contains documentation in the HTML format.
|
|||||||
%prep
|
%prep
|
||||||
%autosetup -n sphinx-%{upstream_version} -p1
|
%autosetup -n sphinx-%{upstream_version} -p1
|
||||||
|
|
||||||
|
# Drop test-dependency on pytest-xdist
|
||||||
|
# This allows for parallel testing, but has a lot of dependencies.
|
||||||
|
# We want to avoid the dependency in RHEL, where it is not available.
|
||||||
|
%if 0%{?rhel}
|
||||||
|
sed -i -e '/pytest-xdist/d' pyproject.toml
|
||||||
|
%endif
|
||||||
|
|
||||||
|
# sphinx 9.1.0 requires pytest >= 9, which we don't have in Fedora yet
|
||||||
|
sed -i '/"pytest>=/ s/>=[^",]*//' pyproject.toml
|
||||||
|
|
||||||
|
# Drop test-dependency on defusedxml,
|
||||||
|
# use xml from the standard library instead.
|
||||||
|
# defusedxml is safer but this is only used in tests.
|
||||||
|
# Upstream uses defusedxml to be "safer for future contributors when they
|
||||||
|
# create/open branches and pull requests" -- that does not concern us.
|
||||||
|
# https://github.com/sphinx-doc/sphinx/pull/12168#discussion_r1535383868
|
||||||
|
# We want to avoid the dependency in RHEL, but no harm in doing so unconditionally.
|
||||||
|
sed -i '/"defusedxml/d' pyproject.toml
|
||||||
|
sed -i 's/from defusedxml./from xml.etree./' sphinx/testing/util.py tests/test_theming/test_theming.py
|
||||||
|
|
||||||
|
%if %{without snowballstemmer}
|
||||||
|
# Drop dependency on snowballstemmer for RHEL, implement dummy method instead
|
||||||
|
sed -i -e '/snowballstemmer/d' pyproject.toml
|
||||||
|
sed -i -e 's/^import \(snowballstemmer\)/from . import dummystemmer as \1/' sphinx/search/*.py
|
||||||
|
cat > sphinx/search/dummystemmer.py <<_EOF
|
||||||
|
class stemmer:
|
||||||
|
def __init__(self, *args, **kwargs): pass
|
||||||
|
def stemWord(self, word): return word
|
||||||
|
_EOF
|
||||||
|
%endif
|
||||||
|
|
||||||
%if %{without imagemagick_tests}
|
%if %{without imagemagick_tests}
|
||||||
rm tests/test_extensions/test_ext_imgconverter.py
|
rm -r tests/test_ext_imgconverter/
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%generate_buildrequires
|
%generate_buildrequires
|
||||||
%pyproject_buildrequires -r %{?with_tests:-x test}
|
%pyproject_buildrequires %{?with_tests:-g test}
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
@@ -355,6 +469,14 @@ k="not test_autodoc_type_aliases"
|
|||||||
k="${k} and not linkcheck and not test_latex_images and not test_build_latex_doc"
|
k="${k} and not linkcheck and not test_latex_images and not test_build_latex_doc"
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if %{without snowballstemmer}
|
||||||
|
# Without snowballstemmer, some tests have to be skipped as well,
|
||||||
|
# as the results with dummystemmer do not exactly match the testcases
|
||||||
|
k="${k} and not test_meta_keys_are_handled_for_language_en and not test_stemmer"
|
||||||
|
k="${k} and not test_term_in_heading_and_section and not test_IndexBuilder"
|
||||||
|
k="${k} and not test_check_js_search_indexes"
|
||||||
|
%endif
|
||||||
|
|
||||||
%pytest -k "${k}"
|
%pytest -k "${k}"
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@@ -370,10 +492,10 @@ k="${k} and not linkcheck and not test_latex_images and not test_build_latex_doc
|
|||||||
%dir %{_datadir}/sphinx/locale/*
|
%dir %{_datadir}/sphinx/locale/*
|
||||||
%{_mandir}/man1/sphinx-*
|
%{_mandir}/man1/sphinx-*
|
||||||
|
|
||||||
|
%if %{undefined rhel}
|
||||||
%files -n python%{python3_pkgversion}-sphinx-latex
|
%files -n python%{python3_pkgversion}-sphinx-latex
|
||||||
# empty, this is a metapackage
|
# empty, this is a metapackage
|
||||||
|
%endif
|
||||||
|
|
||||||
%files doc
|
%files doc
|
||||||
%license LICENSE.rst
|
%license LICENSE.rst
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
SHA512 (sphinx-7.3.7.tar.gz) = f450eaaa26a0989e9065174e23488a7f647221750238516c5d06d403540eb4277fd480f03857d24acb6b7335458ae4535ad1ad533eff6d3bbba5521d9a6deb14
|
SHA512 (sphinx-9.1.0.tar.gz) = 2c8b16935e14a8f827110461c530275f431949159eef47380198115d8abadaafdca06680c09722c0df7fd8ed8e16dbe1e3aa62a774164b7987247f6d8f8a20d3
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
From 57433d8036ab1e88ad7d6c4c1a45e438f722e276 Mon Sep 17 00:00:00 2001
|
From 399ae81dfbedb7b8acf84e56b0e4b2d5023432ec Mon Sep 17 00:00:00 2001
|
||||||
From: Karolina Surma <ksurma@redhat.com>
|
From: Karolina Surma <ksurma@redhat.com>
|
||||||
Date: Thu, 25 Apr 2024 16:07:56 +0200
|
Date: Wed, 26 Feb 2025 10:43:44 +0100
|
||||||
Subject: [PATCH] Patch test_theming to accomodate for Fedora-added theme
|
Subject: [PATCH] Patch test_theming to accomodate for Fedora-added theme
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -8,18 +8,18 @@ Subject: [PATCH] Patch test_theming to accomodate for Fedora-added theme
|
|||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
diff --git a/tests/test_theming/test_theming.py b/tests/test_theming/test_theming.py
|
diff --git a/tests/test_theming/test_theming.py b/tests/test_theming/test_theming.py
|
||||||
index 867f8a0..281bb45 100644
|
index 173e0c9..515e546 100644
|
||||||
--- a/tests/test_theming/test_theming.py
|
--- a/tests/test_theming/test_theming.py
|
||||||
+++ b/tests/test_theming/test_theming.py
|
+++ b/tests/test_theming/test_theming.py
|
||||||
@@ -50,7 +50,7 @@ def test_theme_api(app, status, warning):
|
@@ -58,7 +58,7 @@ def test_theme_api(app: SphinxTestApp) -> None:
|
||||||
]
|
]
|
||||||
|
|
||||||
# test Theme class API
|
# test Theme class API
|
||||||
- assert set(app.registry.html_themes.keys()) == set(themes)
|
- assert set(app.registry.html_themes.keys()) == set(themes)
|
||||||
+ assert set(app.registry.html_themes.keys()) >= set(themes)
|
+ assert set(app.registry.html_themes.keys()) >= set(themes)
|
||||||
assert app.registry.html_themes['test-theme'] == str(
|
assert app.registry.html_themes['test-theme'] == (
|
||||||
app.srcdir / 'test_theme' / 'test-theme'
|
app.srcdir / 'test_theme' / 'test-theme'
|
||||||
)
|
)
|
||||||
--
|
--
|
||||||
2.44.0
|
2.48.1
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
summary: run the basic documentation build
|
||||||
|
test: |
|
||||||
|
sphinx-build -M html source/ build/ &&
|
||||||
|
grep '<script src="_static/jquery.js' build/html/index.html &&
|
||||||
|
grep '<script src="_static/_sphinx_javascript_frameworks_compat.js' build/html/index.html &&
|
||||||
|
test -f build/html/_static/jquery.js &&
|
||||||
|
test -f build/html/_static/_sphinx_javascript_frameworks_compat.js &&
|
||||||
|
rm -rf build/
|
||||||
|
require:
|
||||||
|
- python3-sphinx
|
||||||
|
- python3-sphinxcontrib-jquery
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
project = 'Test'
|
||||||
|
copyright = '2024, Test'
|
||||||
|
author = 'Test'
|
||||||
|
release = '0.3.0'
|
||||||
|
extensions = [
|
||||||
|
"sphinxcontrib.jquery",
|
||||||
|
]
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
Test docfile
|
||||||
|
============
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
:caption: Contents:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Indices and tables
|
||||||
|
==================
|
||||||
|
|
||||||
|
* :ref:`genindex`
|
||||||
|
* :ref:`modindex`
|
||||||
|
* :ref:`search`
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
summary: run the basic documentation build
|
||||||
|
test: |
|
||||||
|
sphinx-build -M html source/ build/ &&
|
||||||
|
grep '<section id="test-docfile">' build/html/index.html &&
|
||||||
|
grep '<h1>Test docfile' build/html/index.html &&
|
||||||
|
grep '_static/alabaster.css' build/html/index.html &&
|
||||||
|
rm -rf build/
|
||||||
|
require:
|
||||||
|
- python3-sphinx
|
||||||
|
- python3-sphinx-theme-alabaster
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
project = 'Test'
|
||||||
|
copyright = '2024, Test'
|
||||||
|
author = 'Test'
|
||||||
|
release = '0.3.0'
|
||||||
|
html_theme = 'alabaster'
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
Test docfile
|
||||||
|
============
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
:caption: Contents:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Indices and tables
|
||||||
|
==================
|
||||||
|
|
||||||
|
* :ref:`genindex`
|
||||||
|
* :ref:`modindex`
|
||||||
|
* :ref:`search`
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
summary: run the basic documentation build with sphinx-rtd-theme
|
||||||
|
test: |
|
||||||
|
sphinx-build -M html source/ build/ &&
|
||||||
|
grep '<section id="test-docfile">' build/html/index.html &&
|
||||||
|
grep '<h1>Test docfile' build/html/index.html &&
|
||||||
|
grep 'SphinxRtdTheme' build/html/_static/js/theme.js &&
|
||||||
|
grep '<script src="_static/js/theme.js' build/html/index.html &&
|
||||||
|
rm -rf build/
|
||||||
|
require:
|
||||||
|
- python3-sphinx
|
||||||
|
- python3-sphinx_rtd_theme
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
project = 'Test'
|
||||||
|
copyright = '2024, Test'
|
||||||
|
author = 'Test'
|
||||||
|
release = '0.3.0'
|
||||||
|
html_theme = 'sphinx_rtd_theme'
|
||||||
|
extensions = [
|
||||||
|
'sphinx_rtd_theme',
|
||||||
|
]
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
Test docfile
|
||||||
|
============
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
:caption: Contents:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Indices and tables
|
||||||
|
==================
|
||||||
|
|
||||||
|
* :ref:`genindex`
|
||||||
|
* :ref:`modindex`
|
||||||
|
* :ref:`search`
|
||||||
Reference in New Issue
Block a user