Blame python-mplcairo.spec

cddae7d
%global srcname mplcairo
cddae7d
cddae7d
Name:           python-%{srcname}
216d9a3
Version:        0.3
216d9a3
Release:        1%{?dist}
cddae7d
Summary:        A (new) cairo backend for Matplotlib
cddae7d
cddae7d
License:        MIT
b934dd9
URL:            https://github.com/matplotlib/mplcairo
b934dd9
Source0:        %pypi_source
cddae7d
cddae7d
BuildRequires:  gcc-c++
cddae7d
cddae7d
%description
cddae7d
This is a new, essentially complete implementation of a cairo backend for
cddae7d
Matplotlib. It can be used in combination with a Qt5, GTK3, Tk, wx, or macOS
cddae7d
UI, or noninteractively (i.e., to save figure to various file formats).
cddae7d
Noteworthy points include:
cddae7d
  - Improved accuracy (e.g., with marker positioning, quad meshes, and text
cddae7d
    kerning).
cddae7d
  - Support for a wider variety of font formats, such as otf and pfb, for vector
cddae7d
    (PDF, PS, SVG) backends (Matplotlib's Agg backend also supports such fonts).
cddae7d
  - Optional support for complex text layout (right-to-left languages, etc.)
cddae7d
    using Raqm.
cddae7d
  - Support for embedding URLs in PDF (but not SVG) output.
cddae7d
  - Support for multi-page output both for PDF and PS (Matplotlib only supports
cddae7d
    multi-page PDF).
cddae7d
  - Support for custom blend modes (see `examples/operators.py`).
cddae7d
cddae7d
cddae7d
%package -n     python3-%{srcname}
cddae7d
Summary:        %{summary}
cddae7d
%{?python_provide:%python_provide python3-%{srcname}}
cddae7d
cddae7d
BuildRequires:  cairo-devel >= 1.15.4
cddae7d
BuildRequires:  freetype-devel
216d9a3
BuildRequires:  libraqm-devel >= 0.7.0
cddae7d
BuildRequires:  python3-devel
cddae7d
BuildRequires:  python3dist(matplotlib) >= 2.2
cddae7d
BuildRequires:  python3-matplotlib-test-data >= 2.2
216d9a3
BuildRequires:  python3dist(pillow)
216d9a3
BuildRequires:  python3dist(pybind11) >= 2.5
4535819
BuildRequires:  python3dist(pycairo) >= 1.16
cddae7d
BuildRequires:  python3dist(pytest) >= 3.2.2
b934dd9
BuildRequires:  python3dist(pytest-xdist)
cddae7d
BuildRequires:  python3dist(setuptools)
cddae7d
BuildRequires:  python3dist(setuptools-scm)
cddae7d
BuildRequires:  python3dist(sphinx)
d578b17
BuildRequires:  tex(avant.sty)
d578b17
BuildRequires:  tex(cmss10.tfm)
d578b17
BuildRequires:  tex(cmss12.tfm)
d578b17
BuildRequires:  tex(courier.sty)
d578b17
BuildRequires:  tex(ecrm1000.tfm)
d578b17
BuildRequires:  tex(geometry.sty)
d578b17
BuildRequires:  tex(helvet.sty)
d578b17
BuildRequires:  tex(chancery.sty)
d578b17
BuildRequires:  tex(charter.sty)
d578b17
BuildRequires:  tex(inputenc.sty)
d578b17
BuildRequires:  tex(mathpazo.sty)
d578b17
BuildRequires:  tex(mathptmx.sty)
d578b17
BuildRequires:  tex(preview.sty)
d578b17
BuildRequires:  tex(sfmath.sty)
d578b17
BuildRequires:  tex(textcomp.sty)
d578b17
BuildRequires:  tex(txfonts.sty)
d578b17
BuildRequires:  tex(type1cm.sty)
d578b17
BuildRequires:  tex(type1ec.sty)
d578b17
BuildRequires:  tex(utf8x.def)
cddae7d
cddae7d
Requires:       cairo >= 1.15.4
216d9a3
Requires:       libraqm >= 0.7.0
cddae7d
cddae7d
%description -n python3-%{srcname}
cddae7d
This is a new, essentially complete implementation of a cairo backend for
cddae7d
Matplotlib. It can be used in combination with a Qt5, GTK3, Tk, wx, or macOS
cddae7d
UI, or noninteractively (i.e., to save figure to various file formats).
cddae7d
Noteworthy points include:
cddae7d
  - Improved accuracy (e.g., with marker positioning, quad meshes, and text
cddae7d
    kerning).
cddae7d
  - Support for a wider variety of font formats, such as otf and pfb, for vector
cddae7d
    (PDF, PS, SVG) backends (Matplotlib's Agg backend also supports such fonts).
cddae7d
  - Optional support for complex text layout (right-to-left languages, etc.)
cddae7d
    using Raqm.
cddae7d
  - Support for embedding URLs in PDF (but not SVG) output.
cddae7d
  - Support for multi-page output both for PDF and PS (Matplotlib only supports
cddae7d
    multi-page PDF).
cddae7d
  - Support for custom blend modes (see `examples/operators.py`).
cddae7d
cddae7d
cddae7d
%prep
cddae7d
%autosetup -n %{srcname}-%{version} -p1
cddae7d
cddae7d
# Remove bundled egg-info and vendoring
cddae7d
rm -rf %{srcname}.egg-info vendor
cddae7d
cddae7d
cddae7d
%build
b934dd9
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
216d9a3
%py3_build
cddae7d
cddae7d
cddae7d
%install
b934dd9
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
cddae7d
%py3_install
cddae7d
cddae7d
cddae7d
%check
cddae7d
export PYTHONPATH="%{buildroot}%{python3_sitearch}" PYTHONDONTWRITEBYTECODE=1
cddae7d
cddae7d
%{__python3} -c 'import mplcairo.base'
cddae7d
cddae7d
MPLBACKEND=module://mplcairo.base %{__python3} - <
cddae7d
import matplotlib.pyplot as plt
cddae7d
print(plt.get_backend())
cddae7d
fig, ax = plt.subplots()
cddae7d
fig.savefig("/dev/null", format="png")
cddae7d
EOF
cddae7d
cddae7d
# 50 is upstream recommended tolerance since results won't match MPL exactly.
b934dd9
%{__python3} run-mpl-test-suite.py --tolerance=50 -m 'not network' -v -n auto
cddae7d
cddae7d
cddae7d
%files -n python3-%{srcname}
cddae7d
%license LICENSE.txt
cddae7d
%doc README.rst
cddae7d
%{python3_sitearch}/%{srcname}
cddae7d
%{python3_sitearch}/%{srcname}.pth
216d9a3
%{python3_sitearch}/%{srcname}-%{version}-py*.egg-info
cddae7d
cddae7d
cddae7d
%changelog
216d9a3
* Mon May 04 2020 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.3-1
216d9a3
- Update to latest version
216d9a3
abfc644
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.2-2
abfc644
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
abfc644
b934dd9
* Mon Sep 23 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.2-1
b934dd9
- Update to latest version
b934dd9
c98d4be
* Mon Aug 19 2019 Miro HronĨok <mhroncok@redhat.com> - 0.1-4
c98d4be
- Rebuilt for Python 3.8
c98d4be
5d4d6b5
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1-3
5d4d6b5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
5d4d6b5
272c891
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1-2
272c891
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
272c891
cddae7d
* Mon Jul 23 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.1-1
cddae7d
- Update to final release
cddae7d
cddae7d
* Mon Apr 16 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.1-0.2.a1
cddae7d
- Remove bundled eggs.
cddae7d
- Add checks and missing Requires.
cddae7d
cddae7d
* Tue Mar 13 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.1-0.1.a1
cddae7d
- Initial package.