Compare commits

..

No commits in common. 'c8' and 'c9' have entirely different histories.
c8 ... c9

2
.gitignore vendored

@ -1 +1 @@
SOURCES/Sphinx-1.7.6.tar.gz SOURCES/Sphinx-3.4.3.tar.gz

@ -1 +1 @@
3caa8c2d3f9b283e32df259baee885c0340c5d02 SOURCES/Sphinx-1.7.6.tar.gz e72412976b8b47cb5a55cc1cb5ec2fdfe358ed7c SOURCES/Sphinx-3.4.3.tar.gz

@ -0,0 +1,25 @@
From 924b2e2cee46753d26a8419f273ffe045bbfb9bb Mon Sep 17 00:00:00 2001
From: Karolina Surma <ksurma@redhat.com>
Date: Tue, 21 Nov 2023 11:27:42 +0100
Subject: [PATCH] Enable autodoc build with extension modules
---
sphinx/ext/autodoc/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py
index 54e91a1..dba5769 100644
--- a/sphinx/ext/autodoc/__init__.py
+++ b/sphinx/ext/autodoc/__init__.py
@@ -1871,7 +1871,7 @@ class DataDocumenter(GenericAliasMixin, NewTypeMixin, TypeVarMixin,
for (classname, attrname), annotation in analyzer.annotations.items():
if classname == '' and attrname not in annotations:
annotations[attrname] = annotation
- except AttributeError:
+ except (AttributeError, PycodeError):
pass
def import_object(self, raiseerror: bool = False) -> bool:
--
2.41.0

@ -1,149 +0,0 @@
diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py
index 8b63352..1a95c77 100644
--- a/sphinx/builders/html.py
+++ b/sphinx/builders/html.py
@@ -14,7 +14,6 @@ import posixpath
import re
import sys
import warnings
-from hashlib import md5
from os import path
import docutils
@@ -40,7 +39,7 @@ from sphinx.highlighting import PygmentsBridge
from sphinx.locale import _, __, l_
from sphinx.search import js_index
from sphinx.theming import HTMLThemeFactory
-from sphinx.util import jsonimpl, logging, status_iterator
+from sphinx.util import jsonimpl, logging, status_iterator, md5
from sphinx.util.console import bold, darkgreen # type: ignore
from sphinx.util.docutils import is_html5_writer_available, new_document
from sphinx.util.fileutil import copy_asset
diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py
index 08707b7..9d53a0e 100644
--- a/sphinx/ext/graphviz.py
+++ b/sphinx/ext/graphviz.py
@@ -13,7 +13,6 @@
import codecs
import posixpath
import re
-from hashlib import sha1
from os import path
from subprocess import Popen, PIPE
@@ -25,7 +24,7 @@ from six import text_type
import sphinx
from sphinx.errors import SphinxError
from sphinx.locale import _, __
-from sphinx.util import logging
+from sphinx.util import logging, sha1
from sphinx.util.i18n import search_image_for_language
from sphinx.util.osutil import ensuredir, ENOENT, EPIPE, EINVAL
diff --git a/sphinx/ext/imgmath.py b/sphinx/ext/imgmath.py
index 5f9d7a1..23f89ed 100644
--- a/sphinx/ext/imgmath.py
+++ b/sphinx/ext/imgmath.py
@@ -14,7 +14,6 @@ import posixpath
import re
import shutil
import tempfile
-from hashlib import sha1
from os import path
from subprocess import Popen, PIPE
@@ -26,7 +25,7 @@ from sphinx.errors import SphinxError, ExtensionError
from sphinx.ext.mathbase import get_node_equation_number
from sphinx.ext.mathbase import setup_math as mathbase_setup, wrap_displaymath
from sphinx.locale import _
-from sphinx.util import logging
+from sphinx.util import logging, sha1
from sphinx.util.osutil import ensuredir, ENOENT, cd
from sphinx.util.png import read_png_depth, write_png_depth
from sphinx.util.pycompat import sys_encoding
diff --git a/sphinx/ext/inheritance_diagram.py b/sphinx/ext/inheritance_diagram.py
index 14593ac..9576d07 100644
--- a/sphinx/ext/inheritance_diagram.py
+++ b/sphinx/ext/inheritance_diagram.py
@@ -39,7 +39,6 @@ r"""
import inspect
import re
import sys
-from hashlib import md5
from docutils import nodes
from docutils.parsers.rst import Directive, directives
@@ -50,7 +49,7 @@ import sphinx
from sphinx.ext.graphviz import render_dot_html, render_dot_latex, \
render_dot_texinfo, figure_wrapper
from sphinx.pycode import ModuleAnalyzer
-from sphinx.util import force_decode
+from sphinx.util import force_decode, md5
if False:
# For type annotation
diff --git a/sphinx/transforms/post_transforms/images.py b/sphinx/transforms/post_transforms/images.py
index 6dd135e..d1c50bd 100644
--- a/sphinx/transforms/post_transforms/images.py
+++ b/sphinx/transforms/post_transforms/images.py
@@ -10,14 +10,13 @@
"""
import os
-from hashlib import sha1
from math import ceil
from docutils import nodes
from six import text_type
from sphinx.transforms import SphinxTransform
-from sphinx.util import epoch_to_rfc1123, rfc1123_to_epoch
+from sphinx.util import epoch_to_rfc1123, rfc1123_to_epoch, sha1
from sphinx.util import logging, requests
from sphinx.util.images import guess_mimetype, get_image_extension, parse_data_uri
from sphinx.util.osutil import ensuredir, movefile
diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py
index dda3fb0..9c1c441 100644
--- a/sphinx/util/__init__.py
+++ b/sphinx/util/__init__.py
@@ -11,6 +11,7 @@
from __future__ import absolute_import
import fnmatch
+import hashlib
import os
import posixpath
import re
@@ -164,6 +165,32 @@ class FilenameUniqDict(dict):
# type: (Set[unicode]) -> None
self._existing = state
+def md5(data=b'', **kwargs):
+ """Wrapper around hashlib.md5
+ Attempt call with 'usedforsecurity=False' if we get a ValueError, which happens when
+ OpenSSL FIPS mode is enabled:
+ ValueError: error:060800A3:digital envelope routines:EVP_DigestInit_ex:disabled for fips
+ See: https://github.com/sphinx-doc/sphinx/issues/7611
+ """
+
+ try:
+ return hashlib.md5(data, **kwargs) # type: ignore
+ except ValueError:
+ return hashlib.md5(data, **kwargs, usedforsecurity=False) # type: ignore
+
+
+def sha1(data=b'', **kwargs):
+ """Wrapper around hashlib.sha1
+ Attempt call with 'usedforsecurity=False' if we get a ValueError
+ See: https://github.com/sphinx-doc/sphinx/issues/7611
+ """
+
+ try:
+ return hashlib.sha1(data, **kwargs) # type: ignore
+ except ValueError:
+ return hashlib.sha1(data, **kwargs, usedforsecurity=False) # type: ignore
+
+
def copy_static_entry(source, targetdir, builder, context={},
exclude_matchers=(), level=0):

@ -0,0 +1,12 @@
diff -ru Sphinx-1.7.6/tests/test_theming.py Sphinx-1.7.6_patched/tests/test_theming.py
--- Sphinx-1.7.6/tests/test_theming.py 2018-07-16 11:24:40.000000000 +0200
+++ Sphinx-1.7.6_patched/tests/test_theming.py 2018-07-20 15:17:35.049263077 +0200
@@ -31,7 +31,7 @@
themes.append('alabaster')
# test Theme class API
- assert set(app.html_themes.keys()) == set(themes)
+ assert set(app.html_themes.keys()) >= set(themes)
assert app.html_themes['test-theme'] == app.srcdir / 'test_theme' / 'test-theme'
assert app.html_themes['ziptheme'] == app.srcdir / 'ziptheme.zip'
assert app.html_themes['staticfiles'] == app.srcdir / 'test_theme' / 'staticfiles'

@ -1,13 +0,0 @@
diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py
index 55f48cd..78ccecd 100644
--- a/tests/test_build_latex.py
+++ b/tests/test_build_latex.py
@@ -1009,7 +1009,7 @@ def test_latex_raw_directive(app, status, warning):
assert 'HTML: abc ghi' in result
assert 'LaTeX: abc def ghi' in result
-
+@pytest.mark.xfail(reason="this test requires internet connection")
@pytest.mark.sphinx('latex', testroot='images')
def test_latex_remote_images(app, status, warning):
app.builder.build_all()

@ -1,99 +1,117 @@
# When bootstrapping sphinx, we don't yet have sphinxcontrib-websupport
# Without it we have warnings in docs, but it's not a hard dependency
%bcond_without websupport
# Also, we don't have all the tests requirements
%bcond_without tests
# Unset -s on python shebang to allow RPM-installed sphinx to be used
# with user-installed modules (#1903763)
%global py3_shebang_flags %nil
# No internet in Koji
%bcond_with internet
%if 0%{?rhel} > 7
# Build without BuildRequires ImageMagick, to skip imgconverter tests # Build without BuildRequires ImageMagick, to skip imgconverter tests
%bcond_with imagemagick_tests %bcond_with imagemagick_tests
%else
%bcond_without imagemagick_tests
%endif
# During texlive updates, sometimes the latex environment is unstable
%bcond_without latex_tests
%global upstream_name Sphinx %global upstream_name Sphinx
Name: python-sphinx Name: python-sphinx
Version: 1.7.6 %global general_version 3.4.3
Release: 3%{?dist} #global prerel ...
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
Release: 8%{?dist}
Epoch: 1 Epoch: 1
Summary: Python documentation generator Summary: Python documentation generator
# Unless otherwise noted, the license for code is BSD # Unless otherwise noted, the license for code is BSD
# sphinx/util/stemmer.py Public Domain # sphinx/util/inspect.py has bits licensed with PSF license v2 (Python)
# sphinx/pycode/pgen2 Python # sphinx/themes/haiku/static/haiku.css_t has bits licensed with MIT
# jquery (MIT or GPLv2) # JS: JQuery, Underscore, css3-mediaqueries are available under MIT
License: BSD and Public Domain and Python and (MIT or GPLv2) License: BSD and Python and MIT
URL: http://sphinx-doc.org/
Source0: https://files.pythonhosted.org/packages/source/S/%{upstream_name}/%{upstream_name}-%{version}.tar.gz URL: https://www.sphinx-doc.org/
Source0: %{pypi_source %{upstream_name} %{upstream_version}}
# Make the test_latex_remote_images an expected failure
# since it requires an active internet connection # Allow extra themes to exist. We pull in python3-sphinx-theme-alabaster
# to fetch images, which is not possible in koji or mock. # which causes that test to fail.
Patch0: xfail-test_latex_remote_images.patch Patch1: sphinx-test_theming.diff
# Building the documentation of other projects under FIPS mode # Fix autodoc build with extension modules:
# might fail in some cases due to the md5 algorithm being disabled. # additionally to AttributeError catch also PycodeError
# Backport an upstream fix to resolve that: # Upstream has replaced one with another in Sphinx 3.5.x and later,
# https://github.com/sphinx-doc/sphinx/pull/7614 # but to prevent any compatibility issues it's safer to only extend
Patch1: fix-build-under-fips.patch # the list of exceptions. Upstream fix:
# https://github.com/sphinx-doc/sphinx/commit/50295f18c25020e15e9bc398a0689
# Bug: https://issues.redhat.com/browse/RHEL-5664
Patch2: Enable-autodoc-build-with-extension-modules.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: make
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: pyproject-rpm-macros
%if %{with websupport}
BuildRequires: python%{python3_pkgversion}-sphinxcontrib-websupport
%endif
# for fixes # for fixes
BuildRequires: dos2unix BuildRequires: dos2unix
# for testing %if %{with tests}
# tests import _testcapi
BuildRequires: python%{python3_pkgversion}-test
BuildRequires: gcc
BuildRequires: gettext BuildRequires: gettext
BuildRequires: texinfo
BuildRequires: graphviz BuildRequires: graphviz
BuildRequires: texinfo
%if %{with imagemagick_tests} %if %{with imagemagick_tests}
BuildRequires: ImageMagick BuildRequires: ImageMagick
%endif %endif
%if %{with latex_tests}
BuildRequires: texlive-collection-fontsrecommended BuildRequires: texlive-collection-fontsrecommended
BuildRequires: texlive-collection-latex BuildRequires: texlive-collection-latex
BuildRequires: texlive-dvipng BuildRequires: texlive-dvipng
BuildRequires: texlive-dvisvgm BuildRequires: texlive-dvisvgm
BuildRequires: texlive-ucs BuildRequires: tex(amsmath.sty)
BuildRequires: tex(amsthm.sty)
BuildRequires: tex(anyfontsize.sty)
BuildRequires: tex(article.cls)
BuildRequires: tex(capt-of.sty)
BuildRequires: tex(cmap.sty) BuildRequires: tex(cmap.sty)
BuildRequires: tex(ecrm1000.tfm) BuildRequires: tex(color.sty)
BuildRequires: tex(footnote.sty) BuildRequires: tex(ctablestack.sty)
BuildRequires: tex(fancyhdr.sty)
BuildRequires: tex(fancyvrb.sty)
BuildRequires: tex(fncychap.sty)
BuildRequires: tex(framed.sty) BuildRequires: tex(framed.sty)
BuildRequires: tex(multirow.sty) BuildRequires: tex(FreeSerif.otf)
BuildRequires: tex(geometry.sty)
BuildRequires: tex(hyperref.sty)
BuildRequires: tex(kvoptions.sty)
BuildRequires: tex(luatex85.sty)
BuildRequires: tex(needspace.sty)
BuildRequires: tex(parskip.sty) BuildRequires: tex(parskip.sty)
BuildRequires: tex(polyglossia.sty)
BuildRequires: tex(tabulary.sty)
BuildRequires: tex(titlesec.sty) BuildRequires: tex(titlesec.sty)
BuildRequires: tex(threeparttable.sty)
BuildRequires: tex(upquote.sty) BuildRequires: tex(upquote.sty)
BuildRequires: tex(utf8x.def)
BuildRequires: tex(wrapfig.sty) BuildRequires: tex(wrapfig.sty)
BuildRequires: tex(capt-of.sty) %endif
BuildRequires: tex(needspace.sty) %endif
BuildRequires: tex(eqparbox.sty)
BuildRequires: tex(amsmath.sty)
BuildRequires: tex(amsthm.sty)
BuildRequires: tex(amssymb.sty)
BuildRequires: tex(amsfonts.sty)
BuildRequires: tex(bm.sty)
BuildRequires: tex(palatino.sty)
BuildRequires: tex(multirow.sty)
BuildRequires: tex(eqparbox.sty)
BuildRequires: tex(atbegshi.sty)
BuildRequires: tex(anyfontsize.sty)
BuildRequires: tex(luatex85.sty)
BuildRequires: tex(fncychap.sty)
BuildRequires: tex(tabulary.sty)
BuildRequires: tex(polyglossia.sty)
BuildRequires: tex(ctablestack.sty)
BuildRequires: tex(eu1enc.def)
BuildRequires: python3-devel
BuildRequires: python3-babel
BuildRequires: python3-setuptools
BuildRequires: python3-docutils
BuildRequires: python3-jinja2
BuildRequires: python3-pygments
BuildRequires: python3-nose
BuildRequires: python3-pytest
BuildRequires: python3-mock
BuildRequires: python3-html5lib
BuildRequires: python3-whoosh
BuildRequires: python3-snowballstemmer
BuildRequires: python3-six
BuildRequires: python3-sphinx_rtd_theme
BuildRequires: python3-sphinx-theme-alabaster
BuildRequires: python3-sphinxcontrib-websupport
BuildRequires: python3-packaging
BuildRequires: python3-imagesize
BuildRequires: python3-requests
%description %description
@ -125,38 +143,22 @@ the Python docs:
snippets and inclusion of appropriately formatted docstrings. snippets and inclusion of appropriately formatted docstrings.
%package -n python2-sphinx %package -n python%{python3_pkgversion}-sphinx
Summary: Python documentation generator Summary: Python documentation generator
Requires: python-sphinx-locale = %{?epoch}:%{version}-%{release}
Requires: python2-babel
Requires: python2-docutils
Requires: python2-jinja2
Requires: python2-pygments
Requires: python2-mock
Requires: python2-snowballstemmer
Requires: python2-sphinx_rtd_theme
Requires: python2-six
Requires: python2-sphinx-theme-alabaster
Requires: python2-imagesize
Requires: python2-requests
Requires: python2-packaging
Requires: python2-typing
Requires: environment(modules)
# Needed to get rid of the alternatives config installed in f24 and f25
# versions of the package
Requires(pre): /usr/sbin/alternatives
Recommends: graphviz Recommends: graphviz
Recommends: ImageMagick Recommends: ImageMagick
Obsoletes: python-sphinx <= 1.2.3
Obsoletes: python-sphinxcontrib-napoleon < 0.5 # Bundled JavaScript
Provides: python-sphinxcontrib-napoleon = %{?epoch}:%{version}-%{release} Provides: bundled(jquery) = 3.5.1
Obsoletes: python2-Sphinx <= 1.3.1-4 Provides: bundled(underscore) = 1.3.1
Provides: python2-Sphinx = %{?epoch}:%{version}-%{release} Provides: bundled(css3-mediaqueries) = 1.0
Provides: python(Sphinx) = %{?epoch}:%{version}-%{release}
%{?python_provide:%python_provide python2-sphinx} # Obsolete and provide the locale package for a clean upgrade path from RHEL 8->9
Conflicts: python3-sphinx < %{?epoch}:%{version}-%{release} Obsoletes: python-sphinx-locale < 1:2
Provides: python-sphinx-locale = %{epoch}:%{version}-%{release}
%description -n python2-sphinx
%description -n python%{python3_pkgversion}-sphinx
Sphinx is a tool that makes it easy to create intelligent and Sphinx is a tool that makes it easy to create intelligent and
beautiful documentation for Python projects (or other documents beautiful documentation for Python projects (or other documents
consisting of multiple reStructuredText sources), written by Georg consisting of multiple reStructuredText sources), written by Georg
@ -185,46 +187,44 @@ the Python docs:
snippets and inclusion of appropriately formatted docstrings. snippets and inclusion of appropriately formatted docstrings.
%package latex %package -n python%{python3_pkgversion}-sphinx-latex
Summary: LaTeX builder dependencies for %{name} Summary: LaTeX builder dependencies for python%{python3_pkgversion}-sphinx
Requires: python(Sphinx) = %{?epoch}:%{version}-%{release}
Requires: python%{python3_pkgversion}-sphinx = %{epoch}:%{version}-%{release}
Requires: texlive-collection-fontsrecommended Requires: texlive-collection-fontsrecommended
Requires: texlive-collection-latex Requires: texlive-collection-latex
Requires: texlive-dvipng Requires: texlive-dvipng
Requires: texlive-dvisvgm Requires: texlive-dvisvgm
Requires: texlive-ucs Requires: tex(amsmath.sty)
Requires: tex(amsthm.sty)
Requires: tex(anyfontsize.sty)
Requires: tex(article.cls)
Requires: tex(capt-of.sty)
Requires: tex(cmap.sty) Requires: tex(cmap.sty)
Requires: tex(ecrm1000.tfm) Requires: tex(color.sty)
Requires: tex(footnote.sty) Requires: tex(ctablestack.sty)
Requires: tex(fancyhdr.sty)
Requires: tex(fancyvrb.sty)
Requires: tex(fncychap.sty)
Requires: tex(framed.sty) Requires: tex(framed.sty)
Requires: tex(multirow.sty) Requires: tex(FreeSerif.otf)
Requires: tex(geometry.sty)
Requires: tex(hyperref.sty)
Requires: tex(kvoptions.sty)
Requires: tex(luatex85.sty)
Requires: tex(needspace.sty)
Requires: tex(parskip.sty) Requires: tex(parskip.sty)
Requires: tex(polyglossia.sty)
Requires: tex(tabulary.sty)
Requires: tex(titlesec.sty) Requires: tex(titlesec.sty)
Requires: tex(threeparttable.sty)
Requires: tex(upquote.sty) Requires: tex(upquote.sty)
Requires: tex(utf8x.def)
Requires: tex(wrapfig.sty) Requires: tex(wrapfig.sty)
Requires: tex(capt-of.sty)
Requires: tex(needspace.sty)
Requires: tex(eqparbox.sty)
Requires: tex(amsmath.sty)
Requires: tex(amsthm.sty)
Requires: tex(amssymb.sty)
Requires: tex(amsfonts.sty)
Requires: tex(bm.sty)
Requires: tex(palatino.sty)
Requires: tex(multirow.sty)
Requires: tex(eqparbox.sty)
Requires: tex(atbegshi.sty)
Requires: tex(anyfontsize.sty)
Requires: tex(luatex85.sty)
Requires: tex(fncychap.sty)
Requires: tex(tabulary.sty)
Requires: tex(polyglossia.sty)
Requires: tex(ctablestack.sty)
Requires: tex(eu1enc.def)
Obsoletes: python3-sphinx-latex < 1.4.4-2
%description latex # No files in this package, automatic provides don't work:
%py_provides python%{python3_pkgversion}-sphinx-latex
%description -n python%{python3_pkgversion}-sphinx-latex
Sphinx is a tool that makes it easy to create intelligent and Sphinx is a tool that makes it easy to create intelligent and
beautiful documentation for Python projects (or other documents beautiful documentation for Python projects (or other documents
consisting of multiple reStructuredText sources), written by Georg consisting of multiple reStructuredText sources), written by Georg
@ -236,69 +236,10 @@ This package pulls in the TeX dependencies needed by Sphinx's LaTeX
builder. builder.
%package -n python3-sphinx
Summary: Python documentation generator
Group: Development/Tools
Requires: python-sphinx-locale = %{?epoch}:%{version}-%{release}
Requires: python3-babel
Requires: python3-docutils
Requires: python3-jinja2
Requires: python3-pygments
Requires: python3-mock
Requires: python3-snowballstemmer
Requires: python3-sphinx_rtd_theme
Requires: python3-sphinx-theme-alabaster
Requires: python3-sphinxcontrib-websupport
Requires: python3-imagesize
Requires: python3-requests
Requires: python3-six
Requires: python3-packaging
Recommends: graphviz
Recommends: ImageMagick
Requires: environment(modules)
# Needed to get rid of the alternatives config installed in f24 and f25
# versions of the package
Requires(pre): /usr/sbin/alternatives
Obsoletes: python3-sphinxcontrib-napoleon < 0.3.0
Provides: python3-sphinxcontrib-napoleon = %{?epoch}:%{version}-%{release}
Provides: python(Sphinx) = %{?epoch}:%{version}-%{release}
%{?python_provide:%python_provide python3-sphinx}
Conflicts: python2-Sphinx < %{?epoch}:%{version}-%{release}
%description -n python3-sphinx
Sphinx is a tool that makes it easy to create intelligent and
beautiful documentation for Python projects (or other documents
consisting of multiple reStructuredText sources), written by Georg
Brandl. It was originally created to translate the new Python
documentation, but has now been cleaned up in the hope that it will be
useful to many other projects.
Sphinx uses reStructuredText as its markup language, and many of its
strengths come from the power and straightforwardness of
reStructuredText and its parsing and translating suite, the Docutils.
Although it is still under constant development, the following
features are already present, work fine and can be seen "in action" in
the Python docs:
* Output formats: HTML (including Windows HTML Help) and LaTeX,
for printable PDF versions
* Extensive cross-references: semantic markup and automatic links
for functions, classes, glossary terms and similar pieces of
information
* Hierarchical structure: easy definition of a document tree, with
automatic links to siblings, parents and children
* Automatic indices: general index as well as a module index
* Code handling: automatic highlighting using the Pygments highlighter
* Various extensions are available, e.g. for automatic testing of
snippets and inclusion of appropriately formatted docstrings.
%package doc %package doc
Summary: Documentation for %{name} Summary: Documentation for %{name}
Group: Documentation
License: BSD License: BSD
Recommends: python(Sphinx) = %{?epoch}:%{version}-%{release} Recommends: python%{python3_pkgversion}-sphinx = %{epoch}:%{version}-%{release}
%description doc %description doc
Sphinx is a tool that makes it easy to create intelligent and Sphinx is a tool that makes it easy to create intelligent and
@ -311,37 +252,37 @@ useful to many other projects.
This package contains documentation in reST and HTML formats. This package contains documentation in reST and HTML formats.
%package locale
Summary: Locale files for %{name}
Group: Development/Tools
License: BSD
%description locale
Sphinx is a tool that makes it easy to create intelligent and
beautiful documentation for Python projects (or other documents
consisting of multiple reStructuredText sources), written by Georg
Brandl. It was originally created to translate the new Python
documentation, but has now been cleaned up in the hope that it will be
useful to many other projects.
This package contains locale files for Sphinx
%prep %prep
%autosetup -n %{upstream_name}-%{version}%{?prerel} -p1 %autosetup -n %{upstream_name}-%{upstream_version} -p1
# fix line encoding of bundled jquery.js # fix line encoding of bundled jquery.js
dos2unix -k ./sphinx/themes/basic/static/jquery.js dos2unix -k ./sphinx/themes/basic/static/jquery.js
%if ! %{with imagemagick_tests} %if %{without imagemagick_tests}
rm tests/test_ext_imgconverter.py rm tests/test_ext_imgconverter.py
%endif %endif
# Don't measure coverage:
sed -i '/pytest-cov/d' setup.py
# Not needed on recent Pythons, https://github.com/sphinx-doc/sphinx/pull/8483
sed -i '/typed_ast/d' setup.py
# unwanted dependency in RHEL, https://bugzilla.redhat.com/show_bug.cgi?id=1945182
sed -i '/html5lib/d' setup.py
# Fix broken links in the bundled underscore.js library
sed -i 's|http://documentcloud.github.com/underscore|https://underscorejs.org|' \
./sphinx/themes/basic/static/underscore*
%generate_buildrequires
%pyproject_buildrequires %{?with_tests:-x test}
%build %build
%py3_build %pyproject_wheel
export PYTHONPATH=$PWD export PYTHONPATH=$PWD
pushd doc pushd doc
export SPHINXBUILD="%{__python3} ../sphinx/cmd/build.py" export SPHINXBUILD="%{python3} ../sphinx/cmd/build.py"
make html SPHINXBUILD="$SPHINXBUILD" make html SPHINXBUILD="$SPHINXBUILD"
make man SPHINXBUILD="$SPHINXBUILD" make man SPHINXBUILD="$SPHINXBUILD"
rm -rf _build/html/.buildinfo rm -rf _build/html/.buildinfo
@ -350,16 +291,18 @@ popd
%install %install
%py3_install %pyproject_install
# we keep this for backwards compatibility with Fedora: # For backwards compatibility. Remove with care, if at all
install -d %{buildroot}%{_libexecdir}/python3-sphinx
for i in sphinx-{apidoc,autogen,build,quickstart}; do for i in sphinx-{apidoc,autogen,build,quickstart}; do
ln -s $i %{buildroot}%{_bindir}/$i-%{python3_version} ln -s %{_bindir}/$i %{buildroot}%{_bindir}/$i-%{python3_version}
ln -s $i %{buildroot}%{_bindir}/$i-3 ln -s %{_bindir}/$i %{buildroot}%{_bindir}/$i-3
ln -s %{_bindir}/$i %{buildroot}%{_libexecdir}/python3-sphinx/$i
done done
# Clean up non-python files
rm -f %{buildroot}%{python3_sitelib}/sphinx/locale/.DS_Store
rm -rf %{buildroot}%{python3_sitelib}/sphinx/locale/.tx
pushd doc pushd doc
# Deliver man pages # Deliver man pages
install -d %{buildroot}%{_mandir}/man1 install -d %{buildroot}%{_mandir}/man1
@ -369,21 +312,19 @@ do
done done
popd popd
rm -f %{buildroot}%{python3_sitelib}/sphinx/locale/.DS_Store
rm -rf %{buildroot}%{python3_sitelib}/sphinx/locale/.tx
# Deliver rst files # Deliver rst files
rm -rf doc/_build rm -rf doc/_build
sed -i 's|python ../sphinx-build.py|/usr/bin/sphinx-build|' doc/Makefile sed -i 's|python ../sphinx-build.py|/usr/bin/sphinx-build|' doc/Makefile
mv doc reST mv doc reST
rm reST/make.bat
# Move language files to /usr/share; # Move language files to /usr/share;
# patch to support this incorporated in 0.6.6 # patch to support this incorporated in 0.6.6
pushd %{buildroot}%{python3_sitelib} pushd %{buildroot}%{python3_sitelib}
for lang in `find sphinx/locale -maxdepth 1 -mindepth 1 -type d -not -path '*/\.*' -printf "%f "`;
for lang in `find sphinx/locale -maxdepth 1 -mindepth 1 -type d -not -path '*/\.*' -not -name __pycache__ -printf "%f "`;
do do
test $lang == __pycache__ && continue
install -d %{buildroot}%{_datadir}/sphinx/locale/$lang install -d %{buildroot}%{_datadir}/sphinx/locale/$lang
install -d %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES install -d %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES
mv sphinx/locale/$lang/LC_MESSAGES/sphinx.js \ mv sphinx/locale/$lang/LC_MESSAGES/sphinx.js \
@ -394,6 +335,10 @@ do
done done
popd popd
# Create the sphinxcontrib directory, so we can own it
# See https://bugzilla.redhat.com/show_bug.cgi?id=1669790 for rationale
mkdir %{buildroot}%{python3_sitelib}/sphinxcontrib
%find_lang sphinx %find_lang sphinx
# Language files; Since these are javascript, it's not immediately obvious to # Language files; Since these are javascript, it's not immediately obvious to
@ -402,63 +347,184 @@ popd
's:\(.*/locale/\)\([^/_]\+\)\(.*\.js$\):%lang(\2) \1\2\3:' \ 's:\(.*/locale/\)\([^/_]\+\)\(.*\.js$\):%lang(\2) \1\2\3:' \
>> sphinx.lang >> sphinx.lang
%check
# Currently, all linkcheck tests hit external websites. Since network access
# is disabled in koji, we have to disable these.
rm tests/test_build_linkcheck.py
PYTHON=python3 make test
%if %{with tests}
%check
# Currently, all linkcheck tests and test_latex_images need internet
# Ignored files use html5lib
%pytest \
--ignore tests/test_build_html.py \
--ignore tests/test_build_latex.py \
--ignore tests/test_build_texinfo.py \
--ignore tests/test_domain_std.py \
%if %{without internet}
-k "not linkcheck and not test_latex_images" \
%endif
;
%endif
%files latex
%license LICENSE
%files locale -f sphinx.lang %files -n python%{python3_pkgversion}-sphinx -f sphinx.lang
%license LICENSE %license LICENSE
%doc AUTHORS CHANGES EXAMPLES README.rst
%{_bindir}/sphinx-*
%{python3_sitelib}/sphinx/
%dir %{python3_sitelib}/sphinxcontrib/
%{python3_sitelib}/Sphinx-%{upstream_version}.dist-info/
%dir %{_datadir}/sphinx/ %dir %{_datadir}/sphinx/
%dir %{_datadir}/sphinx/locale %dir %{_datadir}/sphinx/locale
%dir %{_datadir}/sphinx/locale/* %dir %{_datadir}/sphinx/locale/*
%{_mandir}/man1/sphinx-*
%files -n python%{python3_pkgversion}-sphinx-latex
# empty, this is a metapackage
%files -n python3-sphinx
%license LICENSE
%doc AUTHORS CHANGES EXAMPLES README.rst
%{_bindir}/sphinx-*
%{python3_sitelib}/sphinx/
%{python3_sitelib}/Sphinx-%{version}-py%{python3_version}.egg-info/
%{_libexecdir}/python3-sphinx/
%{_mandir}/man1/sphinx-*.1*
%files doc %files doc
%license LICENSE
%doc html reST %doc html reST
%changelog %changelog
* Tue Jul 26 2022 Tomas Orsava <torsava@redhat.com> - 1.7.6-3 * Tue Nov 21 2023 Karolina Surma <ksurma@redhat.com> - 1:3.4.3-8
- Rebuild to include the python-sphinx-latex package in the CodeReady Linux - Fix autodoc build with the compiled extension modules
Builder (CRB) repository Resolves: RHEL-5664
Resolves: rhbz#2081785
* Fri Oct 08 2021 Charalampos Stratakis <cstratak@redhat.com> - 1:3.4.3-7
- Obsolete and provide the python-sphinx-locale package to fix the upgrade path
Related: rhbz#1985219
* Wed Oct 06 2021 Charalampos Stratakis <cstratak@redhat.com> - 1:3.4.3-6
- Fix broken links in the bundled underscore.js library
Resolves: rhbz#1985219
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1:3.4.3-5
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1:3.4.3-4
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Mar 31 2021 Miro Hrončok <mhroncok@redhat.com> - 1:3.4.3-3
- Remove a dependency on html5lib
Resolves: rhbz#1945182
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.4.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jan 19 2021 Charalampos Stratakis <cstratak@redhat.com> - 1:3.4.3-1
- Update to 3.4.3
- Fixes rhbz#1909494
* Sat Dec 05 2020 Mattia Verga <mattia.verga@protonmail.com> - 1:3.3.1-2
- Unset -s from python shebang
- Fixes: rhbz#1903763
* Mon Nov 23 2020 Miro Hrončok <mhroncok@redhat.com> - 1:3.3.1-1
- Update to 3.3.1
- Fixes: rhbz#1893752
* Wed Oct 14 2020 Tomas Hrnciar <thrnciar@redhat.com> - 1:3.2.1-2
- Backport commit to fix python-sphinx with python-pygments v2.7.1
* Tue Aug 18 2020 Miro Hrončok <mhroncok@redhat.com> - 1:3.2.1-1
- Update to 3.2.1
- Remove compatibility symbolic links from /usr/libexec/
- Fixes rhbz#1867294
* Fri Aug 07 2020 Miro Hrončok <mhroncok@redhat.com> - 1:3.1.2-1
- Update to 3.1.2
- Fixes rhbz#1853901
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Oct 14 2020 Charalampos Stratakis <cstratak@redhat.com> - 1:1.7.6-2 * Tue Jun 30 2020 Charalampos Stratakis <cstratak@redhat.com> - 1:3.1.1-1
- Fix documentation build under FIPS mode - Update to 3.1.1 (#1783776)
Resolves: rhbz#1749346
* Thu Jul 19 2018 Charalampos Stratakis <cstratak@redhat.com> - 1:1.7.6-1 * Sat May 23 2020 Miro Hrončok <mhroncok@redhat.com> - 1:2.2.2-4
- Rebuilt for Python 3.9
* Fri May 22 2020 Miro Hrončok <mhroncok@redhat.com> - 1:2.2.2-3
- Bootstrap for Python 3.9
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.2.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Tue Dec 10 2019 Miro Hrončok <mhroncok@redhat.com> - 1:2.2.2-1
- Update to 2.2.2 (rhbz#1743018)
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1:2.1.2-6
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 1:2.1.2-5
- Rebuilt for Python 3.8
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 1:2.1.2-4
- Bootstrap for Python 3.8
* Thu Aug 15 2019 Richard Shaw <hobbes1069@gmail.com> - 1:2.1.2-3
- Rebuild for Python 3.8.
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.1.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sun Jun 23 2019 Miro Hrončok <mhroncok@redhat.com> - 1:2.1.2-1
- Update to 2.1.2 (#1716158)
* Wed Apr 10 2019 Miro Hrončok <mhroncok@redhat.com> - 1:2.0.1-1
- Update to 2.0.1 (#1697544)
- Own the sphinxcontrib directory (#1669790)
* Wed Mar 27 2019 Charalampos Stratakis <cstratak@redhat.com> - 1:2.0.0~b2-1
- Update to 2.0.0b2
* Wed Feb 27 2019 Miro Hrončok <mhroncok@redhat.com> - 1:2.0.0~b1-1
- Update to 2.0.0b1
- Drop Python 2 package
- https://fedoraproject.org/wiki/Changes/Sphinx2
* Thu Feb 07 2019 Alfredo Moralejo <amoralej@redhat.com> - 1:1.8.4-1
- Update to 1.8.4.
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.7.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sun Nov 18 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1:1.7.6-2
- Drop explicit locale setting for python3, use C.UTF-8 for python2
See https://fedoraproject.org/wiki/Changes/Remove_glibc-langpacks-all_from_buildroot
* Mon Jul 23 2018 Marcel Plch <mplch@redhat.com> - 1:1.7.6-1
- Update to 1.7.6 - Update to 1.7.6
* Wed Jun 20 2018 Petr Viktorin <pviktori@redhat.com> - 1:1.7.5-1 * Fri Jul 13 2018 Miro Hrončok <mhroncok@redhat.com> - 1:1.7.5-6
- Remove unused simplejson dependency - Remove unused dependencies on xapian and simplejson
* Thu Jul 5 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1:1.7.5-5
- Add patch to fix build if alabaster theme is installed
- Add patch for #1589868
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 1:1.7.5-4
- Enable tests
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 1:1.7.5-3
- Enable websupport
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 1:1.7.5-2
- Rebuilt for Python 3.7
* Tue Jun 19 2018 Charalampos Stratakis <cstratak@redhat.com> - 1:1.7.5-1 * Tue Jun 19 2018 Charalampos Stratakis <cstratak@redhat.com> - 1:1.7.5-1
- Update to 1.7.5 (bz#1570451) - Update to 1.7.5 (bz#1570451)
* Tue Jun 19 2018 Charalampos Stratakis <cstratak@redhat.com> - 1:1.7.2-5 * Mon Jun 18 2018 Miro Hrončok <mhroncok@redhat.com> - 1:1.7.2-5
- Remove the python-pytest-cov dependency - Rebuilt for Python 3.7
* Wed Jun 13 2018 Miro Hrončok <mhroncok@redhat.com> - 1:1.7.2-4 * Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 1:1.7.2-4
- Remove python2 subpackage - Bootstrap for Python 3.7
- Require python3-sphinxcontrib-websupport
* Thu Jun 07 2018 Petr Viktorin <pviktori@redhat.com> - 1:1.7.2-3 * Thu Jun 14 2018 Miro Hrončok <mhroncok@redhat.com> - 1:1.7.2-3
- Remove hard dependencies on sphinxcontrib-websupport and sqlalchemy - Bootstrap for Python 3.7
* Wed Apr 11 2018 Petr Viktorin <pviktori@redhat.com> - 1:1.7.2-2 * Wed Apr 11 2018 Petr Viktorin <pviktori@redhat.com> - 1:1.7.2-2
- Conditionalize the ImageMagick build dependency & tests - Conditionalize the ImageMagick build dependency & tests

Loading…
Cancel
Save