From 18e05c3ed52905c3131800fa7d7d019d22dc1a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 14 May 2018 13:59:52 +0200 Subject: [PATCH 1/2] Allow bootstrapping sphinx 1. Introduce --without websupport Sphinx (build)requires sphinxcontrib-websupport but that (build)requires sphinx. This bcond can be used to bootstrap this. 2. Introduce --without tests The tests bring a lot of additional dependencies that make bootstrapping harder. This allows to build without tests. 3. Build the docs with self The documentation was built with 'python', thus importing sphinx from python2's sitelib. Sphinx was installed because of the above mentioned buildrequirement of sphinxcontrib-websupport. Now current sphinx from PWD is used, also python3 is used when available, otherwise python2. Never just python. --- python-sphinx.spec | 56 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/python-sphinx.spec b/python-sphinx.spec index 9de6388..b844232 100644 --- a/python-sphinx.spec +++ b/python-sphinx.spec @@ -11,6 +11,11 @@ %bcond_without imagemagick_tests %endif +# When bootstrapping sphinx, we don't yet have sphinxcontrib-websupport +%bcond_without websupport +# Also, we don't have all the tests requirements +%bcond_without tests + # Currently, python2 version is always the default: https://fedoraproject.org/wiki/Packaging:Python#Naming %if 1 %global py3_default 0 @@ -67,13 +72,15 @@ BuildRequires: python2-imagesize BuildRequires: python2-requests BuildRequires: python2-packaging BuildRequires: python2-typing +%if %{with websupport} BuildRequires: python2-sphinxcontrib-websupport +%endif BuildRequires: environment(modules) # for fixes BuildRequires: dos2unix -# for testing +%if %{with tests} BuildRequires: python2-nose BuildRequires: python2-pytest BuildRequires: python2-pytest-cov @@ -126,6 +133,7 @@ BuildRequires: tex(tabulary.sty) BuildRequires: tex(polyglossia.sty) BuildRequires: tex(ctablestack.sty) BuildRequires: tex(eu1enc.def) +%endif %if 0%{?with_python3} BuildRequires: python3-devel @@ -134,6 +142,16 @@ BuildRequires: python3-setuptools BuildRequires: python3-docutils BuildRequires: python3-jinja2 BuildRequires: python3-pygments +BuildRequires: python3-six +BuildRequires: python3-sphinx_rtd_theme +BuildRequires: python3-sphinx-theme-alabaster +BuildRequires: python3-packaging +BuildRequires: python3-imagesize +BuildRequires: python3-requests +%if %{with websupport} +BuildRequires: python3-sphinxcontrib-websupport +%endif +%if %{with tests} BuildRequires: python3-nose BuildRequires: python3-pytest BuildRequires: python3-pytest-cov @@ -143,13 +161,7 @@ BuildRequires: python3-simplejson BuildRequires: python3-html5lib BuildRequires: python3-whoosh BuildRequires: python3-snowballstemmer -BuildRequires: python3-six -BuildRequires: python3-sphinx_rtd_theme -BuildRequires: python3-sphinx-theme-alabaster -BuildRequires: python3-packaging -BuildRequires: python3-imagesize -BuildRequires: python3-requests -BuildRequires: python3-sphinxcontrib-websupport +%endif %endif # with_python3 @@ -198,7 +210,9 @@ Requires: python2-imagesize Requires: python2-requests Requires: python2-packaging Requires: python2-typing +%if %{with websupport} Requires: python2-sphinxcontrib-websupport +%endif Requires: environment(modules) # Needed to get rid of the alternatives config installed in f24 and f25 # versions of the package @@ -310,8 +324,10 @@ Requires: python3-sphinx-theme-alabaster Requires: python3-imagesize Requires: python3-requests Requires: python3-six -Requires: python3-sphinxcontrib-websupport Requires: python3-packaging +%if %{with websupport} +Requires: python3-sphinxcontrib-websupport +%endif Recommends: graphviz Recommends: ImageMagick Requires: environment(modules) @@ -394,10 +410,14 @@ cp %{SOURCE5} . # fix line encoding of bundled jquery.js dos2unix -k ./sphinx/themes/basic/static/jquery.js -%if ! %{with imagemagick_tests} +%if %{without imagemagick_tests} rm tests/test_ext_imgconverter.py %endif +%if %{without websupport} +rm tests/test_websupport.py tests/test_api_translator.py +%endif + %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} @@ -409,9 +429,16 @@ cp -a . %{py3dir} %py3_build %endif # with_python3 +export PYTHONPATH=$PWD pushd doc -make html -make man +%if 0%{?with_python3} +export SPHINXBUILD="%{__python3} ../sphinx/cmd/build.py" +%else +export SPHINXBUILD="%{__python2} ../sphinx/cmd/build.py" +%endif + +make html SPHINXBUILD="$SPHINXBUILD" +make man SPHINXBUILD="$SPHINXBUILD" rm -rf _build/html/.buildinfo mv _build/html .. popd @@ -520,10 +547,14 @@ done >> sphinx.lang +%if %{with tests} %check +export PYTHONPATH=$PWD + # 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 + # Igoring test_api_translator for now as it fails on Fedora. # The issue has been reported upstream: https://github.com/sphinx-doc/sphinx/issues/4710 LANG=en_US.UTF-8 %{__python2} -m pytest -v --ignore=tests/test_api_translator.py @@ -535,6 +566,7 @@ rm tests/test_build_linkcheck.py LANG=en_US.UTF-8 PYTHON=python3 make test popd %endif # with_python3 +%endif # with tests %files latex From 10199b3e749a2d2eea72214914ed01793424ea8b Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 19 Jun 2018 17:19:54 +0200 Subject: [PATCH 2/2] Update to 1.7.5 (bz#1570451) --- .gitignore | 1 + fix-test_autodoc.patch | 32 -------------------------------- python-sphinx.spec | 11 +++++------ sources | 2 +- 4 files changed, 7 insertions(+), 39 deletions(-) delete mode 100644 fix-test_autodoc.patch diff --git a/.gitignore b/.gitignore index 30051b9..28bb3f3 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ /Sphinx-1.6.6.tar.gz /Sphinx-1.7.1.tar.gz /Sphinx-1.7.2.tar.gz +/Sphinx-1.7.5.tar.gz diff --git a/fix-test_autodoc.patch b/fix-test_autodoc.patch deleted file mode 100644 index f3d969b..0000000 --- a/fix-test_autodoc.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py -index e8427fd84..492db8700 100644 ---- a/sphinx/util/inspect.py -+++ b/sphinx/util/inspect.py -@@ -313,7 +313,10 @@ def __init__(self, subject, bound_method=False): - try: - self.signature = inspect.signature(subject) - except IndexError: -- if hasattr(subject, '_partialmethod'): # partialmethod with no argument -+ # Until python 3.6.4, cpython has been crashed on inspection for -+ # partialmethods not having any arguments. -+ # https://bugs.python.org/issue33009 -+ if hasattr(subject, '_partialmethod'): - self.signature = None - self.partialmethod_with_noargs = True - else: -diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py -index 9398edc34..ed6d050fa 100644 ---- a/tests/test_autodoc.py -+++ b/tests/test_autodoc.py -@@ -952,7 +952,10 @@ def call_autodoc(objtype, name): - ' Update state of cell to *state*.', - ' ', - ] -- if sys.version_info < (3, 5, 4): -+ if (sys.version_info < (3, 5, 4) or -+ (3, 6, 5) <= sys.version_info < (3, 7) or -+ (3, 7, 0, 'beta', 3) <= sys.version_info): -+ # TODO: this condition should be updated after 3.7-final release. - expected = '\n'.join(expected).replace(' -> None', '').split('\n') - - assert call_autodoc('class', 'target.partialmethod.Cell') == expected diff --git a/python-sphinx.spec b/python-sphinx.spec index b844232..dba317e 100644 --- a/python-sphinx.spec +++ b/python-sphinx.spec @@ -26,8 +26,8 @@ %global upstream_name Sphinx Name: python-sphinx -Version: 1.7.2 -Release: 2%{?dist} +Version: 1.7.5 +Release: 1%{?dist} Epoch: 1 Summary: Python documentation generator @@ -54,10 +54,6 @@ Source6: default-sphinx-command.in # to fetch images, which is not possible in koji or mock. Patch0: xfail-test_latex_remote_images.patch -# Fix test_autodoc failure with Python 3.6.5 -# Fixed upstream: https://github.com/sphinx-doc/sphinx/pull/4822 -patch1: fix-test_autodoc.patch - BuildArch: noarch BuildRequires: python2-devel >= 2.4 BuildRequires: python2-babel @@ -622,6 +618,9 @@ popd %changelog +* Tue Jun 19 2018 Charalampos Stratakis - 1:1.7.5-1 +- Update to 1.7.5 (bz#1570451) + * Wed Apr 11 2018 Petr Viktorin - 1:1.7.2-2 - Conditionalize the ImageMagick build dependency & tests diff --git a/sources b/sources index cbcc203..bf910c5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Sphinx-1.7.2.tar.gz) = 6cb055d969227c727e1cdd8865ddef700d72217e0ef3700383449921e9310f7ed6266d62cf1928ad64372f93468d457c584fac34f6583714cc8a9a3627785ac3 +SHA512 (Sphinx-1.7.5.tar.gz) = db2a8df2cdb2ed78ce2341175575c2b04a149451b2bc8a4f74ddc73e308a19d505874fdbae4e370ce48a9b1cdb4de47cdab489bc57c1b378e857d5b8d04a07b8