python-matplotlib/python-matplotlib.spec

448 lines
14 KiB
RPMSpec
Raw Normal View History

2020-07-19 04:27:41 +00:00
%bcond_with html
%bcond_without check
# https://fedorahosted.org/fpc/ticket/381
%bcond_without bundled_fonts
# No WX for EL8/ELN/EL9
%if 0%{?rhel} >= 8
%bcond_with wx
%else
%bcond_without wx
%endif
2018-08-14 09:54:43 +00:00
# the default backend; one of GTK3Agg GTK3Cairo MacOSX Qt4Agg Qt5Agg TkAgg
# WXAgg Agg Cairo PS PDF SVG
2014-02-11 14:17:25 +00:00
%global backend TkAgg
2015-02-26 01:41:46 +00:00
%if "%{backend}" == "TkAgg"
%global backend_subpackage tk
%else
2021-08-21 01:22:02 +00:00
% if "%{backend}" == "Qt5Agg"
2015-02-26 01:41:46 +00:00
%global backend_subpackage qt5
2021-08-21 01:22:02 +00:00
% else
% if "%{backend}" == "WXAgg"
%global backend_subpackage wx
2015-02-26 01:41:46 +00:00
% endif
% endif
%endif
2015-02-25 04:07:46 +00:00
# Use the same directory of the main package for subpackage licence and docs
%global _docdir_fmt %{name}
2018-11-10 09:33:30 +00:00
# Updated test images for new FreeType.
2023-08-12 00:55:05 +00:00
%global mpl_images_version 3.8.0rc1
2018-11-10 09:33:30 +00:00
2018-03-31 07:28:44 +00:00
# The version of FreeType in this Fedora branch.
2023-07-07 01:01:14 +00:00
%global ftver 2.13.1
2018-03-31 07:28:44 +00:00
Name: python-matplotlib
2023-08-12 00:55:05 +00:00
Version: 3.8.0~rc1
%global Version 3.8.0rc1
2021-11-18 07:31:45 +00:00
Release: %autorelease
2012-11-27 20:01:54 +00:00
Summary: Python 2D plotting library
# qt_editor backend is MIT
2022-11-30 06:57:46 +00:00
# ResizeObserver at end of lib/matplotlib/backends/web_backend/js/mpl.js is CC0
License: PSF-2.0 and MIT and CC0-1.0
URL: https://matplotlib.org
Source0: %pypi_source matplotlib %{Version}
2021-08-24 08:09:03 +00:00
Source1: mplsetup.cfg
2012-11-27 20:01:54 +00:00
2018-03-31 07:28:44 +00:00
# Fedora-specific patches; see:
2019-04-23 10:17:43 +00:00
# https://github.com/fedora-python/matplotlib/tree/fedora-patches
2018-03-31 07:28:44 +00:00
# Updated test images for new FreeType.
2018-11-10 09:33:30 +00:00
Source1000: https://github.com/QuLogic/mpl-images/archive/v%{mpl_images_version}-with-freetype-%{ftver}/matplotlib-%{mpl_images_version}-with-freetype-%{ftver}.tar.gz
2018-03-31 07:28:44 +00:00
# Search in /etc/matplotlibrc:
Patch1001: 0001-matplotlibrc-path-search-fix.patch
2023-08-12 00:55:05 +00:00
# We don't need to use NumPy 1.25.
Patch1002: 0002-Unpin-NumPy-build-requirement.patch
2019-05-31 05:44:54 +00:00
# Increase tolerances for new FreeType everywhere:
2023-02-28 03:29:17 +00:00
Patch1003: 0003-Set-FreeType-version-to-%{ftver}-and-update-tolerances.patch
2020-06-30 00:38:52 +00:00
# https://github.com/matplotlib/matplotlib/pull/21190#issuecomment-1223271888
Patch0001: 0004-Use-old-stride_windows-implementation-on-32-bit-x86.patch
2023-08-12 00:55:05 +00:00
# https://github.com/matplotlib/matplotlib/pull/26502
Patch0002: 0005-TST-Increase-some-tolerances-for-non-x86-arches.patch
2023-08-11 17:20:57 +00:00
2018-08-14 10:15:50 +00:00
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: glibc-langpack-en
2012-11-27 20:01:54 +00:00
BuildRequires: freetype-devel
BuildRequires: libpng-devel
BuildRequires: qhull-devel
BuildRequires: xorg-x11-server-Xvfb
2012-11-27 20:01:54 +00:00
BuildRequires: zlib-devel
2020-06-30 09:42:19 +00:00
BuildRequires: ghostscript
# No ImageMagick for EL8/ELN/EL9
2021-11-17 06:25:26 +00:00
%if 0%{?fedora} || (0%{?rhel} && 0%{?rhel} < 8)
2020-06-30 09:42:19 +00:00
BuildRequires: ImageMagick
%endif
2020-06-30 09:42:19 +00:00
BuildRequires: inkscape
BuildRequires: font(dejavusans)
BuildRequires: font(notosanscjkjp)
BuildRequires: font(wenquanyizenhei)
BuildRequires: texlive-collection-basic
BuildRequires: texlive-collection-fontsrecommended
BuildRequires: texlive-collection-latex
BuildRequires: texlive-collection-latexrecommended
2020-06-30 09:42:19 +00:00
BuildRequires: texlive-dvipng
BuildRequires: texlive-latex-bin
BuildRequires: texlive-luahbtex
BuildRequires: texlive-tex-bin
BuildRequires: texlive-xetex-bin
# Search for documentclass and add the classes here.
BuildRequires: tex(article.cls)
# Search for inputenc and add any encodings used with it.
BuildRequires: tex(utf8.def)
BuildRequires: tex(utf8x.def)
# Found with: rg -Io 'usepackage(\[.+\])?\{.+\}' lib | rg -o '\{.+\}' | sort -u
# and then removing duplicates in one line, etc.
2020-05-21 13:04:31 +00:00
BuildRequires: tex(avant.sty)
BuildRequires: tex(chancery.sty)
BuildRequires: tex(charter.sty)
2021-11-18 07:31:45 +00:00
BuildRequires: tex(chemformula.sty)
BuildRequires: tex(color.sty)
2020-05-21 13:04:31 +00:00
BuildRequires: tex(courier.sty)
BuildRequires: tex(fontenc.sty)
BuildRequires: tex(fontspec.sty)
2020-05-21 13:04:31 +00:00
BuildRequires: tex(geometry.sty)
BuildRequires: tex(graphicx.sty)
2020-05-21 13:04:31 +00:00
BuildRequires: tex(helvet.sty)
BuildRequires: tex(hyperref.sty)
BuildRequires: tex(import.sty)
2020-05-21 13:04:31 +00:00
BuildRequires: tex(inputenc.sty)
BuildRequires: tex(lmodern.sty)
2020-05-21 13:04:31 +00:00
BuildRequires: tex(mathpazo.sty)
BuildRequires: tex(mathptmx.sty)
BuildRequires: tex(pgf.sty)
2020-05-21 13:04:31 +00:00
BuildRequires: tex(sfmath.sty)
BuildRequires: tex(textcomp.sty)
BuildRequires: tex(txfonts.sty)
BuildRequires: tex(type1cm.sty)
2020-05-21 13:04:31 +00:00
BuildRequires: tex(type1ec.sty)
BuildRequires: tex(underscore.sty)
# See BakomaFonts._fontmap in lib/matplotlib/mathtext.py
BuildRequires: tex(cmb10.tfm)
BuildRequires: tex(cmex10.tfm)
BuildRequires: tex(cmmi10.tfm)
BuildRequires: tex(cmr10.tfm)
BuildRequires: tex(cmss10.tfm)
BuildRequires: tex(cmsy10.tfm)
BuildRequires: tex(cmtt10.tfm)
2020-05-21 13:04:31 +00:00
%description
2020-03-04 04:05:13 +00:00
Matplotlib is a Python 2D plotting library which produces publication
quality figures in a variety of hardcopy formats and interactive
2020-03-04 04:05:13 +00:00
environments across platforms. Matplotlib can be used in Python
scripts, the Python and IPython shell, web application servers, and
various graphical user interface toolkits.
Matplotlib tries to make easy things easy and hard things possible.
You can generate plots, histograms, power spectra, bar charts,
errorcharts, scatterplots, etc, with just a few lines of code.
%package -n python3-matplotlib-data
Summary: Data used by python-matplotlib
BuildArch: noarch
2020-07-19 04:27:41 +00:00
%if %{with bundled_fonts}
Requires: python3-matplotlib-data-fonts = %{version}-%{release}
%endif
Obsoletes: python-matplotlib-data < 3
%description -n python3-matplotlib-data
%{summary}
2020-07-19 04:27:41 +00:00
%if %{with bundled_fonts}
%package -n python3-matplotlib-data-fonts
Summary: Fonts used by python-matplotlib
2022-11-30 06:57:46 +00:00
# Carlogo, STIX and Computer Modern is OFL
2018-09-21 08:25:34 +00:00
# DejaVu is Bitstream Vera and Public Domain
2022-11-30 06:57:46 +00:00
License: OFL-1.1 and Bitstream-Vera and LicenseRef-Fedora-Public-Domain
BuildArch: noarch
Requires: python3-matplotlib-data = %{version}-%{release}
Obsoletes: python-matplotlib-data-fonts < 3
%description -n python3-matplotlib-data-fonts
%{summary}
%endif
2012-11-27 20:01:54 +00:00
%package -n python3-matplotlib
Summary: Python 2D plotting library
BuildRequires: python3-devel
BuildRequires: python3dist(pycairo)
BuildRequires: python3dist(pytz)
BuildRequires: python3dist(sphinx)
Requires: dejavu-sans-fonts
Recommends: texlive-dvipng
Requires: (texlive-dvipng if texlive-base)
Requires: python3-matplotlib-data = %{version}-%{release}
Requires: python3dist(pycairo)
Requires: python3-matplotlib-%{?backend_subpackage}%{!?backend_subpackage:tk}%{?_isa} = %{version}-%{release}
2020-07-19 04:27:41 +00:00
%if %{with check}
BuildRequires: python3dist(pytest)
BuildRequires: python3dist(pytest-rerunfailures)
BuildRequires: python3dist(pytest-timeout)
BuildRequires: python3dist(pytest-xdist)
BuildRequires: python3dist(pikepdf)
%endif
2020-07-19 04:27:41 +00:00
%if %{without bundled_fonts}
2015-11-15 13:16:29 +00:00
Requires: stix-math-fonts
%else
Provides: bundled(stix-math-fonts)
%endif
2012-11-27 20:01:54 +00:00
%description -n python3-matplotlib
2020-03-04 04:05:13 +00:00
Matplotlib is a Python 2D plotting library which produces publication
2012-11-27 20:01:54 +00:00
quality figures in a variety of hardcopy formats and interactive
2020-03-04 04:05:13 +00:00
environments across platforms. Matplotlib can be used in Python
scripts, the Python and IPython shell, web application servers, and
various graphical user interface toolkits.
2012-11-27 20:01:54 +00:00
Matplotlib tries to make easy things easy and hard things possible.
You can generate plots, histograms, power spectra, bar charts,
errorcharts, scatterplots, etc, with just a few lines of code.
%package -n python3-matplotlib-qt5
Summary: Qt5 backend for python3-matplotlib
BuildRequires: python3dist(cairocffi)
BuildRequires: python3dist(pyqt5)
Requires: python3-matplotlib%{?_isa} = %{version}-%{release}
Requires: python3dist(cairocffi)
Requires: python3dist(pyqt5)
2021-08-21 01:22:02 +00:00
Obsoletes: python3-matplotlib-qt4 < 3.5.0-0
%description -n python3-matplotlib-qt5
%{summary}
%package -n python3-matplotlib-qt6
Summary: Qt6 backend for python3-matplotlib
BuildRequires: python3dist(cairocffi)
BuildRequires: python3dist(pyqt6)
Requires: python3-matplotlib%{?_isa} = %{version}-%{release}
Requires: python3dist(cairocffi)
Requires: python3dist(pyqt6)
%description -n python3-matplotlib-qt6
%{summary}
2015-02-26 02:33:05 +00:00
%package -n python3-matplotlib-gtk3
Summary: GTK3 backend for python3-matplotlib
# This should be converted to typelib(Gtk) when supported
BuildRequires: gtk3
BuildRequires: python3-gobject
Requires: gtk3%{?_isa}
Requires: python3-gobject%{?_isa}
Requires: python3-matplotlib%{?_isa} = %{version}-%{release}
2015-02-26 02:33:05 +00:00
%description -n python3-matplotlib-gtk3
%{summary}
%package -n python3-matplotlib-gtk4
Summary: GTK4 backend for python3-matplotlib
# This should be converted to typelib(Gtk) when supported
BuildRequires: gtk4
BuildRequires: python3-gobject
Requires: gtk4%{?_isa}
Requires: python3-gobject%{?_isa}
Requires: python3-matplotlib%{?_isa} = %{version}-%{release}
%description -n python3-matplotlib-gtk4
%{summary}
2012-11-27 20:01:54 +00:00
%package -n python3-matplotlib-tk
Summary: Tk backend for python3-matplotlib
2021-08-24 08:09:03 +00:00
BuildRequires: python3-pillow-tk
2012-11-27 20:01:54 +00:00
BuildRequires: python3-tkinter
Requires: python3-matplotlib%{?_isa} = %{version}-%{release}
2021-08-24 08:09:03 +00:00
Requires: python3-pillow-tk
2012-11-27 20:01:54 +00:00
Requires: python3-tkinter
%description -n python3-matplotlib-tk
%{summary}
%if %{with wx}
%package -n python3-matplotlib-wx
Summary: WX backend for python3-matplotlib
BuildRequires: python3dist(wxpython)
Requires: python3-matplotlib%{?_isa} = %{version}-%{release}
Requires: python3dist(wxpython)
%description -n python3-matplotlib-wx
%{summary}
%endif
2018-08-14 09:54:43 +00:00
%package -n python3-matplotlib-doc
Summary: Documentation files for python-matplotlib
2020-07-19 04:27:41 +00:00
%if %{with html}
2018-08-14 09:54:43 +00:00
BuildRequires: graphviz
2021-08-21 06:23:28 +00:00
BuildRequires: make
BuildRequires: python3dist(sphinx)
2018-08-14 09:54:43 +00:00
BuildRequires: tex(latex)
BuildRequires: tex-preview
%endif
Requires: python3-matplotlib%{?_isa} = %{version}-%{release}
%description -n python3-matplotlib-doc
%{summary}
%package -n python3-matplotlib-test-data
Summary: Test data for python3-matplotlib
Requires: python3-matplotlib%{?_isa} = %{version}-%{release}
%description -n python3-matplotlib-test-data
%{summary}
%prep
2020-06-30 00:38:52 +00:00
%autosetup -n matplotlib-%{Version} -N
2018-11-10 09:33:30 +00:00
2018-01-24 09:27:51 +00:00
# Fedora-specific patches follow:
2023-06-22 08:56:24 +00:00
%autopatch -p1 -m 1000
2023-02-28 03:29:17 +00:00
# Updated test images for new FreeType.
gzip -dc %SOURCE1000 | tar xf - --transform='s~^mpl-images-%{mpl_images_version}-with-freetype-%{ftver}/~~'
2021-02-19 10:46:28 +00:00
2021-08-24 08:09:03 +00:00
# Copy mplsetup.cfg to the builddir
cp -p %{SOURCE1} mplsetup.cfg
# Backports or reported upstream
2023-06-22 08:56:24 +00:00
%autopatch -p1 -M 999
2022-08-12 21:16:43 +00:00
2021-08-21 06:23:28 +00:00
%generate_buildrequires
%pyproject_buildrequires -r
%build
%set_build_flags
export http_proxy=http://127.0.0.1/
2018-08-14 09:54:43 +00:00
2021-08-21 06:23:28 +00:00
MPLCONFIGDIR=$PWD %pyproject_wheel
2020-07-19 04:27:41 +00:00
%if %{with html}
2012-11-27 20:01:54 +00:00
# Need to make built matplotlib libs available for the sphinx extensions:
2021-08-21 06:23:28 +00:00
MPLCONFIGDIR=$PWD \
2023-02-28 03:29:17 +00:00
PYTHONPATH="%{pyproject_site_lib}" \
2021-08-21 06:23:28 +00:00
make -C doc html
%endif
2012-11-27 20:01:54 +00:00
# Ensure all example files are non-executable so that the -doc
# package doesn't drag in dependencies
2023-08-12 00:55:05 +00:00
find galleries -name '*.py' -exec chmod a-x '{}' \;
2011-02-26 15:54:02 +00:00
2020-07-19 04:27:41 +00:00
%install
export http_proxy=http://127.0.0.1/
2018-08-14 09:54:43 +00:00
2021-08-21 06:23:28 +00:00
MPLCONFIGDIR=$PWD %pyproject_install
2021-02-19 10:46:28 +00:00
# Delete unnecessary files.
rm %{buildroot}%{python3_sitearch}/matplotlib/backends/web_backend/.{eslintrc.js,prettierignore,prettierrc}
rm %{buildroot}%{python3_sitearch}/matplotlib/tests/tinypages/.gitignore
rm %{buildroot}%{python3_sitearch}/matplotlib/tests/tinypages/_static/.gitignore
# Move files to Fedora-specific locations.
2015-02-26 04:26:38 +00:00
mkdir -p %{buildroot}%{_sysconfdir} %{buildroot}%{_datadir}/matplotlib
2018-08-14 09:54:43 +00:00
mv %{buildroot}%{python3_sitearch}/matplotlib/mpl-data \
2015-02-26 04:26:38 +00:00
%{buildroot}%{_datadir}/matplotlib
2020-07-19 04:27:41 +00:00
%if %{without bundled_fonts}
2015-02-26 04:26:38 +00:00
rm -rf %{buildroot}%{_datadir}/matplotlib/mpl-data/fonts
%endif
2020-07-19 04:27:41 +00:00
%if %{with check}
%check
2017-09-27 05:29:13 +00:00
# These files confuse pytest, and we want to test the installed copy.
rm -rf build*/
# We need to prime this LaTeX cache stuff, or it might fail while running tests
# in parallel.
2021-02-19 22:00:18 +00:00
mktexfmt latex.fmt
mktexfmt lualatex.fmt
mktexfmt pdflatex.fmt
mktexfmt xelatex.fmt
# Also prime the font cache.
%{py3_test_envvars} %{python3} -c 'import matplotlib.font_manager'
export http_proxy=http://127.0.0.1/
# Skips:
2018-04-01 00:08:43 +00:00
# * test_invisible_Line_rendering: Checks for "slowness" that often fails on a
# heavily-loaded builder.
# * test_form_widget_get_with_datetime_and_date_fields is flaky.
MPLCONFIGDIR=$PWD \
%ifnarch %{ix86}
xvfb-run -a -s "-screen 0 640x480x24" \
%endif
2021-08-21 06:23:28 +00:00
env %{pytest} -ra -n auto \
2018-04-01 00:08:43 +00:00
-m 'not network' \
-k 'not test_invisible_Line_rendering and not test_form_widget_get_with_datetime_and_date_fields' \
2023-02-28 03:29:17 +00:00
--pyargs matplotlib mpl_toolkits.axes_grid1 mpl_toolkits.axisartist mpl_toolkits.mplot3d
%endif
2020-07-19 04:27:41 +00:00
%files -n python3-matplotlib-data
%{_datadir}/matplotlib/mpl-data/
2020-07-19 04:27:41 +00:00
%if %{with bundled_fonts}
%exclude %{_datadir}/matplotlib/mpl-data/fonts/
%endif
2020-07-19 04:27:41 +00:00
%if %{with bundled_fonts}
%files -n python3-matplotlib-data-fonts
%{_datadir}/matplotlib/mpl-data/fonts/
%endif
2018-08-14 09:54:43 +00:00
%files -n python3-matplotlib-doc
2023-08-12 00:55:05 +00:00
%doc galleries/examples
2020-07-19 04:27:41 +00:00
%if %{with html}
2012-11-27 20:01:54 +00:00
%doc doc/build/html/*
%endif
%files -n python3-matplotlib
%license LICENSE/
2023-02-28 03:29:17 +00:00
%doc README.md
2021-08-21 06:23:28 +00:00
%{python3_sitearch}/matplotlib-*.dist-info/
2012-11-27 20:01:54 +00:00
%{python3_sitearch}/matplotlib/
%exclude %{python3_sitearch}/matplotlib/tests/baseline_images/*
2012-11-27 20:01:54 +00:00
%{python3_sitearch}/mpl_toolkits/
2023-02-28 03:29:17 +00:00
%exclude %{python3_sitearch}/mpl_toolkits/*/tests/baseline_images/*
2020-07-19 04:27:41 +00:00
%pycached %{python3_sitearch}/pylab.py
%pycached %exclude %{python3_sitearch}/matplotlib/backends/backend_qt5*.py
2020-07-19 04:27:41 +00:00
%pycached %exclude %{python3_sitearch}/matplotlib/backends/backend_gtk*.py
%pycached %exclude %{python3_sitearch}/matplotlib/backends/_backend_tk.py
%pycached %exclude %{python3_sitearch}/matplotlib/backends/backend_tk*.py
2012-11-27 20:01:54 +00:00
%exclude %{python3_sitearch}/matplotlib/backends/_tkagg.*
2020-07-19 04:27:41 +00:00
%pycached %exclude %{python3_sitearch}/matplotlib/backends/backend_wx*.py
2022-08-12 07:23:30 +00:00
%if %{with html}
2015-02-25 04:07:46 +00:00
%exclude %{_pkgdocdir}/*/
2022-08-12 07:23:30 +00:00
%endif
2012-11-27 20:01:54 +00:00
%files -n python3-matplotlib-test-data
%{python3_sitearch}/matplotlib/tests/baseline_images/
2023-02-28 03:29:17 +00:00
%{python3_sitearch}/mpl_toolkits/*/tests/baseline_images/
%files -n python3-matplotlib-qt5
%pycached %{python3_sitearch}/matplotlib/backends/backend_qt5*.py
# This is handled by backend_qt*.py (no number), so the package exists only for
# the dependencies.
%files -n python3-matplotlib-qt6
2015-02-26 02:33:05 +00:00
%files -n python3-matplotlib-gtk3
%pycached %{python3_sitearch}/matplotlib/backends/backend_gtk3*.py
%files -n python3-matplotlib-gtk4
%pycached %{python3_sitearch}/matplotlib/backends/backend_gtk4*.py
2015-02-26 02:33:05 +00:00
2012-11-27 20:01:54 +00:00
%files -n python3-matplotlib-tk
2020-07-19 04:27:41 +00:00
%pycached %{python3_sitearch}/matplotlib/backends/backend_tk*.py
%pycached %{python3_sitearch}/matplotlib/backends/_backend_tk.py
2012-11-27 20:01:54 +00:00
%{python3_sitearch}/matplotlib/backends/_tkagg.*
2006-07-03 21:30:23 +00:00
%if %{with wx}
%files -n python3-matplotlib-wx
2020-07-19 04:27:41 +00:00
%pycached %{python3_sitearch}/matplotlib/backends/backend_wx*.py
%endif
2018-08-14 01:27:10 +00:00
%changelog
2021-08-13 04:32:59 +00:00
%autochangelog