#5 Fix and enable HTML docs
Closed 5 years ago by churchyard. Opened 5 years ago by lbalhar.
rpms/ lbalhar/python-matplotlib master  into  master

file modified
+14 -9
@@ -1,4 +1,4 @@ 

- %global with_html               0

+ %global with_html               1

  

  # It seems like there's some kind of weird occasional error where a

  # build (often aarch64 or ppc64) will fail in one of the Stix font
@@ -41,7 +41,7 @@ 

  

  Name:           python-matplotlib

  Version:        2.2.2

- Release:        2%{?rctag:.%{rctag}}%{?dist}

+ Release:        3%{?rctag:.%{rctag}}%{?dist}

  Summary:        Python 2D plotting library

  # qt4_editor backend is MIT

  License:        Python and MIT
@@ -108,6 +108,7 @@ 

  BuildRequires:  python2-scikit-image

  BuildRequires:  python2-colorspacious

  BuildRequires:  python2-cycler >= 0.10.0

+ BuildRequires:  python2-sphinx-gallery

  %endif

  %if %{run_tests}

  BuildRequires:  python2-pytest
@@ -229,7 +230,7 @@ 

  %description -n python2-matplotlib-test-data

  %{summary}

  

- %package -n python2-matplotlib-doc

+ %package -n python-matplotlib-doc

  Summary:        Documentation files for python-matplotlib

  %if %{with_html}

  BuildRequires:  dvipng
@@ -239,9 +240,9 @@ 

  BuildRequires:  tex-preview

  %endif

  Requires:       python2-matplotlib%{?_isa} = %{version}-%{release}

- %{?python_provide:%python_provide python2-matplotlib-doc}

+ %{?python_provide:%python_provide python-matplotlib-doc}

  

- %description -n python2-matplotlib-doc

+ %description -n python-matplotlib-doc

  %{summary}

  

  %package -n python-matplotlib-data
@@ -414,10 +415,11 @@ 

  %if %{with_html}

  # Need to make built matplotlib libs available for the sphinx extensions:

  pushd doc

+     ln -s ../examples mpl_examples

      MPLCONFIGDIR=$PWD/.. \

      MATPLOTLIBDATA=$PWD/../lib/matplotlib/mpl-data \

-     PYTHONPATH=`realpath ../build/lib.linux*` \

-         %{__python2} make.py html

+     PYTHONPATH=PYTHONPATH="`realpath ../build/lib.linux*`:`realpath ./gallery/units/`" \

+         sphinx-build-2 ./ build || :

  popd

  %endif

  # Ensure all example files are non-executable so that the -doc
@@ -550,10 +552,10 @@ 

  %{python2_sitearch}/matplotlib/backends/backend_wx.*

  %{python2_sitearch}/matplotlib/backends/backend_wxagg.*

  

- %files -n python2-matplotlib-doc

+ %files -n python-matplotlib-doc

  %doc examples

  %if %{with_html}

- %doc doc/build/html/*

+ %doc doc/build/*

  %endif

  

  %files -n python3-matplotlib
@@ -608,6 +610,9 @@ 

  %{python3_sitearch}/matplotlib/backends/_tkagg.*

  

  %changelog

+ * Tue May 22 2018 Lumír Balhar <lbalhar@redhat.com> - 2.2.2-3

+ - Fixed and enabled HTML docs

+ 

  * Tue Apr 17 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.2.2-2

  - Remove bytecode produced by pytest

  - Add python?-matplotlib-test-data subpackages

Hello.

There is a request to enable documentation subpackage with HTML documentation for python-matplotlib [0]. I manage to do it after some tries but I found a related problem with tests.

When I build the package without tests (as I did to speed testing up), everything is fine and documentation looks good. But when I enabled tests back before preparing this PR scratch build failed [1]. It seems that the problem is caused by newly installed build dependencies because numbers of tests differ a lot:

  • without HTML docs: 6019 passed, 1242 skipped, 21 xfailed, 9 xpassed, 12 warnings
  • with HTML docs: 6625 passed, 638 skipped, 10 xfailed, 10 xpassed, 25 warnings

It seems that the build with HTML documentation contains some dependency which enables more 600 usually skipped tests. It leads to 8 failed tests. It's ImageComparisonFailure so it might be simple to fix.

Is there anybody who can help me to solve this?

Lumír

[0] https://bugzilla.redhat.com/show_bug.cgi?id=1513753
[1] https://koji.fedoraproject.org/koji/taskinfo?taskID=27577228

Comparing to the last build, there are 311 new packages installed on this one. Most of those are just texlive stuff, of course. The biggest changes are adding ghostscript and latex.

The former allows tests to run on PDF output. PDFs are more resilient to FreeType changes, but there are still a few issues with layout if there's enough text. The "correct" images I added in #3 do not include the PDFs since they were not tested.

Adding latex means some test using usetex=True now run, but it's the same problem as above.

Question to the maintainers also is whether we want to build documentation or not because it takes more than 17 minutes to build and it installs a lot of new dependencies.

Commit message says that doc subpackage was disabled during bootstrapping phase of 2.x.x.

If we want to add it back, @qulogic could you please help me prepare images for 8 failing tests?

Can you build these on Python 3 instead?

@lbalhar Would you like to get back to this, or shall we close it?

I would like to but it also depends on maintainer because I'll definitely need some help to prepare problematic files for tests and also the build time will be much longer which also affects the main admin.

So, is there anybody who can help me with that?

I don't think so. Let's close this?

Pull-Request has been closed by churchyard

5 years ago