Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/matplotlib/files/, dev-python/matplotlib/
Date: Fri, 29 Jan 2021 10:43:07
Message-Id: 1611916977.c75dad06a2633931da495ed1a7c166015ed8fd2b.mgorny@gentoo
1 commit: c75dad06a2633931da495ed1a7c166015ed8fd2b
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 29 09:03:37 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 29 10:42:57 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c75dad06
7
8 dev-python/matplotlib: Bump to 3.3.4
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/matplotlib/Manifest | 1 +
13 .../files/matplotlib-3.3.4-test-extra.patch | 12 +
14 dev-python/matplotlib/matplotlib-3.3.4.ebuild | 282 +++++++++++++++++++++
15 3 files changed, 295 insertions(+)
16
17 diff --git a/dev-python/matplotlib/Manifest b/dev-python/matplotlib/Manifest
18 index 507b0f8b7a0..f00b711f586 100644
19 --- a/dev-python/matplotlib/Manifest
20 +++ b/dev-python/matplotlib/Manifest
21 @@ -3,3 +3,4 @@ DIST matplotlib-3.2.2.tar.gz 40295831 BLAKE2B 32fb34b95d1df928f949fd7b04909da249
22 DIST matplotlib-3.3.0.tar.gz 38782487 BLAKE2B 97330d93b8d8a64a1296ccb173e44ebcc54c61e22aacdd73cc38a46fb2d22fbfe7334fb3c6993be001c475724c47f530243affddd71ec647232ac093db6e3135 SHA512 2ffd9e79e300a37092ab4b5a7156c2f57e408975818abd413c74477ad622030c7636695467aab821c9996564cddec57e26ba6a8004f6639070964fcb7a510a75
23 DIST matplotlib-3.3.2.tar.gz 37939974 BLAKE2B f28e184a0fccd4192ba8135b70569bf463d08cae0f4eb8e7f997f417cb947500a9fe46eb5f979473b4d7d22c0ad03ab55aba4067082c86f63eacbf837b8606ad SHA512 cae68e63d879bcfb41b25df4de48472461f7987403d42d34c7205a65ed3ef567660309c04d2a55e155fbe1ef708fd9de0b0d66e71578f34c3ee93379c4ea1e1a
24 DIST matplotlib-3.3.3.tar.gz 37944403 BLAKE2B 30358d7b7df87b0b15724c4eeb132acdacf31ac900d5c06b22c7ebc7217d6cabcc76b7e29cea6af0b4711b5b1724ce34dd065f63cabcfd40c0fcf9788f94c1fe SHA512 36b482a6c36ee08c47f3c02c160289bbdec8746d4d246084723bd3e1fd632c6383f6db58c950a9773a6993d10f24dacd870a91faafc34864616288cd05b6232c
25 +DIST matplotlib-3.3.4.tar.gz 37941665 BLAKE2B 77b86dc3ceec3695a0d749197bcec684893d237da1aaf8778d9dc2038da1ba56b757bbce94efcf215ac30f35420b77e0a0e75ebb75b6d2cde5146d8a35ee25e7 SHA512 aadfe3db4edde9940b9e15daf1b6c5f237d3a6f38610956ceee994f919d711fce818ea12be4db18aa2a8638c4e8f434d79541fecaa7233e233bf4c73792bc4c4
26
27 diff --git a/dev-python/matplotlib/files/matplotlib-3.3.4-test-extra.patch b/dev-python/matplotlib/files/matplotlib-3.3.4-test-extra.patch
28 new file mode 100644
29 index 00000000000..0c62334086a
30 --- /dev/null
31 +++ b/dev-python/matplotlib/files/matplotlib-3.3.4-test-extra.patch
32 @@ -0,0 +1,12 @@
33 +diff -dupr a/lib/mpl_toolkits/tests/test_mplot3d.py b/lib/mpl_toolkits/tests/test_mplot3d.py
34 +--- a/lib/mpl_toolkits/tests/test_mplot3d.py 2021-01-29 10:43:01.196582153 +0100
35 ++++ b/lib/mpl_toolkits/tests/test_mplot3d.py 2021-01-29 10:44:36.084875177 +0100
36 +@@ -150,7 +150,7 @@ def test_contourf3d_fill():
37 + ax.set_zlim(-1, 1)
38 +
39 +
40 +-@mpl3d_image_comparison(['tricontour.png'])
41 ++@mpl3d_image_comparison(['tricontour.png'], tol=0.02)
42 + def test_tricontour():
43 + fig = plt.figure()
44 +
45
46 diff --git a/dev-python/matplotlib/matplotlib-3.3.4.ebuild b/dev-python/matplotlib/matplotlib-3.3.4.ebuild
47 new file mode 100644
48 index 00000000000..a103db251a0
49 --- /dev/null
50 +++ b/dev-python/matplotlib/matplotlib-3.3.4.ebuild
51 @@ -0,0 +1,282 @@
52 +# Copyright 1999-2021 Gentoo Authors
53 +# Distributed under the terms of the GNU General Public License v2
54 +
55 +EAPI=7
56 +
57 +PYTHON_COMPAT=( python3_{7..9} )
58 +PYTHON_REQ_USE='tk?,threads(+)'
59 +
60 +inherit distutils-r1 flag-o-matic virtualx toolchain-funcs prefix
61 +
62 +FT_PV=2.6.1
63 +DESCRIPTION="Pure python plotting library with matlab like syntax"
64 +HOMEPAGE="https://matplotlib.org/"
65 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
66 + test? (
67 + https://downloads.sourceforge.net/project/freetype/freetype2/${FT_PV}/freetype-${FT_PV}.tar.gz
68 + )"
69 +
70 +# Main license: matplotlib
71 +# Some modules: BSD
72 +# matplotlib/backends/qt4_editor: MIT
73 +# Fonts: BitstreamVera, OFL-1.1
74 +LICENSE="BitstreamVera BSD matplotlib MIT OFL-1.1"
75 +SLOT="0"
76 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
77 +IUSE="cairo doc excel examples gtk3 latex qt5 tk webagg wxwidgets"
78 +
79 +# internal copy of pycxx highly patched
80 +# dev-python/pycxx
81 +RDEPEND="
82 + dev-python/certifi[${PYTHON_USEDEP}]
83 + >=dev-python/cycler-0.10.0-r1[${PYTHON_USEDEP}]
84 + >=dev-python/kiwisolver-1.2.0[${PYTHON_USEDEP}]
85 + >=dev-python/numpy-1.18.2[${PYTHON_USEDEP}]
86 + >=dev-python/pillow-7.1.1[jpeg,${PYTHON_USEDEP}]
87 + >=dev-python/pyparsing-1.5.6[${PYTHON_USEDEP}]
88 + dev-python/python-dateutil:0[${PYTHON_USEDEP}]
89 + >=dev-python/pytz-2019.3[${PYTHON_USEDEP}]
90 + >=dev-python/six-1.14.0[${PYTHON_USEDEP}]
91 + dev-python/versioneer[${PYTHON_USEDEP}]
92 + media-fonts/dejavu
93 + media-fonts/stix-fonts
94 + media-libs/freetype:2
95 + media-libs/libpng:0
96 + >=media-libs/qhull-2013:=
97 + cairo? (
98 + dev-python/cairocffi[${PYTHON_USEDEP}]
99 + )
100 + excel? (
101 + dev-python/xlwt[${PYTHON_USEDEP}]
102 + )
103 + gtk3? (
104 + dev-python/pygobject:3[cairo?,${PYTHON_USEDEP}]
105 + x11-libs/gtk+:3[introspection]
106 + )
107 + latex? (
108 + virtual/latex-base
109 + app-text/dvipng
110 + app-text/ghostscript-gpl
111 + app-text/poppler[utils]
112 + dev-texlive/texlive-fontsrecommended
113 + dev-texlive/texlive-latexextra
114 + dev-texlive/texlive-xetex
115 + )
116 + qt5? (
117 + dev-python/PyQt5[gui,widgets,${PYTHON_USEDEP}]
118 + )
119 + webagg? (
120 + >=www-servers/tornado-6.0.4[${PYTHON_USEDEP}]
121 + )
122 + wxwidgets? (
123 + $(python_gen_cond_dep '
124 + dev-python/wxpython:*[${PYTHON_USEDEP}]
125 + ' python3_{6,7,8})
126 + )
127 +"
128 +
129 +BDEPEND="
130 + ${RDEPEND}
131 + virtual/pkgconfig
132 + doc? (
133 + >=app-text/dvipng-1.15-r1
134 + >=dev-python/colorspacious-1.1.2[${PYTHON_USEDEP}]
135 + >=dev-python/ipython-1.18.2[${PYTHON_USEDEP}]
136 + >=dev-python/numpydoc-0.9.2[${PYTHON_USEDEP}]
137 + >=dev-python/scipy-1.4.1[${PYTHON_USEDEP}]
138 + >=dev-python/sphinx-1.3.1[${PYTHON_USEDEP}]
139 + >=dev-python/sphinx-gallery-0.3.1-r1[${PYTHON_USEDEP}]
140 + >=dev-python/xlwt-1.3.0-r1[${PYTHON_USEDEP}]
141 + dev-texlive/texlive-latexextra
142 + dev-texlive/texlive-fontsrecommended
143 + dev-texlive/texlive-latexrecommended
144 + >=media-gfx/graphviz-2.42.3[cairo]
145 + )
146 + test? (
147 + dev-python/flaky[${PYTHON_USEDEP}]
148 + dev-python/mock[${PYTHON_USEDEP}]
149 + dev-python/pygobject:3[cairo?,${PYTHON_USEDEP}]
150 + >=www-servers/tornado-6.0.4[${PYTHON_USEDEP}]
151 + x11-libs/gtk+:3[introspection]
152 + )
153 +"
154 +
155 +# A few C++ source files are written to srcdir.
156 +# Other than that, the ebuild shall be fit for out-of-source build.
157 +DISTUTILS_IN_SOURCE_BUILD=1
158 +
159 +distutils_enable_tests pytest
160 +
161 +pkg_setup() {
162 + unset DISPLAY # bug #278524
163 +}
164 +
165 +use_supported() {
166 + case ${1} in
167 + wxwidgets)
168 + [[ ${EPYTHON} == python3.[678] ]]
169 + ;;
170 + esac
171 +
172 + return 0
173 +}
174 +
175 +use_setup() {
176 + local uword="${2:-${1}}"
177 + if use_supported "${1}" && use "${1}"; then
178 + echo "${uword} = True"
179 + echo "${uword}agg = True"
180 + else
181 + echo "${uword} = False"
182 + echo "${uword}agg = False"
183 + fi
184 +}
185 +
186 +python_prepare_all() {
187 +# Generates test failures, but fedora does it
188 +# local PATCHES=(
189 +# "${FILESDIR}"/${P}-unbundle-pycxx.patch
190 +# "${FILESDIR}"/${P}-unbundle-agg.patch
191 +# )
192 +# rm -r agg24 CXX || die
193 +# rm -r agg24 || die
194 +
195 +# cat > lib/${PN}/externals/six.py <<-EOF
196 +# from __future__ import absolute_import
197 +# from six import *
198 +# EOF
199 +
200 + local PATCHES=(
201 + "${FILESDIR}"/matplotlib-3.3.0-test.patch
202 + "${FILESDIR}"/matplotlib-3.3.2-test-extra.patch
203 + "${FILESDIR}"/matplotlib-3.3.3-disable-lto.patch
204 + "${FILESDIR}"/matplotlib-3.3.4-test-extra.patch
205 + )
206 +
207 + # requires jupyter-nbconvert
208 + rm lib/matplotlib/tests/test_backend_nbagg.py || die
209 +
210 + sed \
211 + -e 's/matplotlib.pyparsing_py[23]/pyparsing/g' \
212 + -i lib/matplotlib/{mathtext,fontconfig_pattern}.py \
213 + || die "sed pyparsing failed"
214 +
215 + sed -e 's:\(@pytest.mark.flaky\)(reruns=3):\1:' \
216 + -i lib/matplotlib/tests/test_*.py || die
217 +
218 + hprefixify setupext.py
219 +
220 + rm -rf libqhull || die
221 +
222 + export XDG_RUNTIME_DIR="${T}/runtime-dir"
223 + mkdir "${XDG_RUNTIME_DIR}" || die
224 + chmod 0700 "${XDG_RUNTIME_DIR}" || die
225 +
226 + distutils-r1_python_prepare_all
227 +}
228 +
229 +python_configure_all() {
230 + append-flags -fno-strict-aliasing
231 + append-cppflags -DNDEBUG # or get old trying to do triangulation
232 + tc-export PKG_CONFIG
233 +}
234 +
235 +python_configure() {
236 + mkdir -p "${BUILD_DIR}" || die
237 +
238 + # create setup.cfg (see setup.cfg.template for any changes).
239 +
240 + # common switches.
241 + cat > "${BUILD_DIR}"/setup.cfg <<- EOF || die
242 + [directories]
243 + basedirlist = ${EPREFIX}/usr
244 + [provide_packages]
245 + pytz = False
246 + dateutil = False
247 + [libs]
248 + system_freetype = True
249 + system_qhull = True
250 + [packages]
251 + tests = $(usex test True False)
252 + [gui_support]
253 + agg = True
254 + gtk = False
255 + gtkagg = False
256 + macosx = False
257 + pyside = False
258 + pysideagg = False
259 + qt4 = False
260 + qt4agg = False
261 + $(use_setup cairo)
262 + $(use_setup gtk3)
263 + $(use_setup qt5)
264 + $(use_setup tk)
265 + $(use_setup wxwidgets wx)
266 + EOF
267 +
268 + if use gtk3 && use cairo; then
269 + echo "gtk3cairo = True" >> "${BUILD_DIR}"/setup.cfg || die
270 + else
271 + echo "gtk3cairo = False" >> "${BUILD_DIR}"/setup.cfg || die
272 + fi
273 +}
274 +
275 +wrap_setup() {
276 + local MAKEOPTS=-j1
277 + local -x MPLSETUPCFG="${BUILD_DIR}"/setup.cfg
278 + "$@"
279 +}
280 +
281 +python_compile() {
282 + wrap_setup distutils-r1_python_compile --build-lib="${BUILD_DIR}"/lib
283 +}
284 +
285 +python_compile_all() {
286 + if use doc; then
287 + cd doc || die
288 +
289 + # necessary for in-source build
290 + local -x PYTHONPATH="${BUILD_DIR}"/build/lib:${PYTHONPATH}
291 +
292 + VARTEXFONTS="${T}"/fonts \
293 + emake SPHINXOPTS= O=-Dplot_formats=png:100 html
294 + fi
295 +}
296 +
297 +src_test() {
298 + virtx distutils-r1_src_test
299 +}
300 +
301 +python_test() {
302 + # we need to rebuild mpl against bundled freetype, otherwise
303 + # over 1000 tests will fail because of mismatched font rendering
304 + grep -v system_freetype "${BUILD_DIR}"/setup.cfg \
305 + > "${BUILD_DIR}"/test-setup.cfg || die
306 + local -x MPLSETUPCFG="${BUILD_DIR}"/test-setup.cfg
307 + ln -s "${WORKDIR}/freetype-${FT_PV}" "${BUILD_DIR}" || die
308 + distutils-r1_python_compile -j1 --build-lib="${BUILD_DIR}"/test-lib
309 + local -x PYTHONPATH=${BUILD_DIR}/test-lib:${PYTHONPATH}
310 +
311 + "${EPYTHON}" -c "import sys, matplotlib as m; sys.exit(m.test(argv=['-m', 'not network'], verbosity=2))" || die
312 +}
313 +
314 +python_install() {
315 + wrap_setup distutils-r1_python_install
316 +
317 + # mpl_toolkits namespace
318 + python_moduleinto mpl_toolkits
319 + python_domodule lib/mpl_toolkits/__init__.py
320 +}
321 +
322 +python_install_all() {
323 + use doc && local HTML_DOCS=( doc/build/html/. )
324 +
325 + distutils-r1_python_install_all
326 +
327 + if use examples; then
328 + dodoc -r examples
329 + docompress -x /usr/share/doc/${PF}/examples
330 + fi
331 +
332 + find "${D}" -name '*.pth' -delete || die
333 +}