From cf56cc754ec4ffc14868ed938e0e161822ef4b27 Mon Sep 17 00:00:00 2001 From: Tim Orling Date: Thu, 12 Oct 2017 23:36:31 -0700 Subject: python-matplotlib: update to v2.1.2; add python3 support * Refactor common metadata to python-matplotlib.inc * Inherit pypi and drop github "archive" SRC_URI * Define FILESEXTRAPATHS so that common patch files are only carried in one location Upstream Release Notes v2.1.2: " The second bug-fix release for the 2.1 series. This release fixes a number of critical bugs: - fix a typo in mlab.cohere which yielded incorrect results - allow nonposx / nonposy to pass through loglog - fix color comparisons when finding handles with legend - fixes a recursive draw bug and a major performance regression in Qt5Agg backend - fix a re-draw bug in WxAgg - fix image scaling with high-bit depth integers - revert the busy-cursor " Upstream Release Notes v2.1.1: " The first and only planned bug-fix release for the 2.1 series. This release include many bug and documentation fixes. Highlights are: - change default logscale behavior to clip - fixed webagg import errors - tweaks to polar ticks - fixed exception when guessing afm family names - update manifest to include all doc files - improve masked array handling in pcolormesh - fix segfault from reading invalid png - fix blocking_input - fix bug resulting in huge multi-page pdf files - make `show` in nbagg take args as other backends do - several fixes to OSX backend - restore positional arg handling on Figure.legend - fix bugs in interactive navigation - fix issues when panning with invalid limits - fix bug with fully masked arrays passed to imshow " Upstream Release Notes v2.1.0: " This is the second minor release in the Matplotlib 2.x series and the first release with major new features since 1.5. This release contains approximately 2 years worth of work by 275 contributors across over 950 pull requests. Highlights from this release include: support for string categorical values export of animations to interactive javascript widgets major overhaul of polar plots reproducible output for ps/eps, pdf, and svg backends performance improvements in drawing lines and images GUIs show a busy cursor while rendering the plot along with many other enhancements and bug fixes " Signed-off-by: Tim Orling --- .../recipes-devtools/python/python-matplotlib.inc | 150 +++++++++++++++++++++ .../python/python-matplotlib/pytest.ini | 4 + .../python/python-matplotlib/run-ptest | 2 + .../python/python-matplotlib_2.0.2.bb | 18 --- .../python/python-matplotlib_2.1.2.bb | 4 + .../python/python3-matplotlib_2.1.2.bb | 2 + 6 files changed, 162 insertions(+), 18 deletions(-) create mode 100644 meta-python/recipes-devtools/python/python-matplotlib.inc create mode 100644 meta-python/recipes-devtools/python/python-matplotlib/pytest.ini create mode 100644 meta-python/recipes-devtools/python/python-matplotlib/run-ptest delete mode 100644 meta-python/recipes-devtools/python/python-matplotlib_2.0.2.bb create mode 100644 meta-python/recipes-devtools/python/python-matplotlib_2.1.2.bb create mode 100644 meta-python/recipes-devtools/python/python3-matplotlib_2.1.2.bb diff --git a/meta-python/recipes-devtools/python/python-matplotlib.inc b/meta-python/recipes-devtools/python/python-matplotlib.inc new file mode 100644 index 0000000000..3c340dab78 --- /dev/null +++ b/meta-python/recipes-devtools/python/python-matplotlib.inc @@ -0,0 +1,150 @@ +DESCRIPTION = "matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats" +SECTION = "devel/python" +LICENSE = "PSF" +LIC_FILES_CHKSUM = "file://LICENSE/LICENSE;md5=afec61498aa5f0c45936687da9a53d74" + +SRC_URI[md5sum] = "cd26ba402c5ead6b0ecc00072f6617b4" +SRC_URI[sha256sum] = "725a3f12739d133adfa381e1b33bd70c6f64db453bfc536e148824816e568894" + +DEPENDS += "freetype \ + libagg \ + libpng \ + ${PYTHON_PN}-cycler \ + ${PYTHON_PN}-dateutil \ + ${PYTHON_PN}-numpy \ + ${PYTHON_PN}-numpy-native \ + ${PYTHON_PN}-pycairo \ + ${PYTHON_PN}-pytz \ + qhull \ + " +RDEPENDS_${PN} = "freetype \ + libagg \ + libpng \ + ${PYTHON_PN}-core \ + ${PYTHON_PN}-cycler \ + ${PYTHON_PN}-dateutil \ + ${PYTHON_PN}-distutils \ + ${PYTHON_PN}-numpy \ + ${PYTHON_PN}-pycairo \ + ${PYTHON_PN}-pyparsing \ + ${PYTHON_PN}-pytz \ + qhull \ + " + +# Use common directory for python2/python3 patches +FILESEXTRAPATHS_prepend := "${THISDIR}/python-matplotlib:" +#file://fix_setupext.patch +SRC_URI += " \ + file://run-ptest \ + file://pytest.ini \ + " + +S = "${WORKDIR}/matplotlib-${PV}" + +EXTRA_OECONF = "--with-python-includes=${STAGING_INCDIR}/../" + +inherit pypi pkgconfig + +export MATPLOTLIB_DIR="${libdir}/${PYTHON_DIR}/site-packages/matplotlib" + +# Supported backends, one of: Agg, Cairo, GTK, GTKAgg, GTKCairo, +# GTK3Agg, GTK3Cairo, MacOSX, Pdf, Ps, Qt4Agg, Qt5Agg, SVG, TkAgg, +# WX, WXAgg. +# +# NOTE: not all of these have been implemented in OE, yet +PACKAGECONFIG ??= "Cairo" +PACKAGECONFIG[Agg] = ",,libagg" +PACKAGECONFIG[Cairo] = ",,${PYTHON_PN}-pycairo-native,${PYTHON_PN}-pycairo" +PACKAGECONFIG[Qt4Agg] = ",,${PYTHON_PN}-pyqt4 libagg" +PACKAGECONFIG[Qt5Agg] = ",,${PYTHON_PN}-pyqt5 libagg" +# NOTE: +# oe-core does not build _tkinter module for python* +# so python*-tkinter module is actually non-functional, +# since http://git.openembedded.org/openembedded-core/commit/?id=8cc5e36cd7978186d5ea1fe8af2f2bd6b3df8885 +PACKAGECONFIG[TkAgg] = ",,${PYTHON_PN}-tkinter tk tk-lib libagg" +PACKAGECONFIG[docs] = "--enable-docs,--disable-docs, \ + ${PYTHON_PN}-sphinx \ + ${PYTHON_PN}-colorspacious \ + ${PYTHON_PN}-ipython \ + ${PYTHON_PN}-mock \ + ${PYTHON_PN}-numpydoc \ + ${PYTHON_PN}-pillow \ + ${PYTHON_PN}-scipy \ + ${PYTHON_PN}-sphinx-gallery" + +python do_write_setup_cfg() { + conf=(d.getVar('PACKAGECONFIG', True) or "").split() + bb.debug(1, "PACKAGECONFIG=%s" % conf) + if 'Agg' in conf: + bb.debug(1, "Configuring Agg backend") + if 'Cairo' in conf: + bb.debug(1, "Configuring Cairo backend") +} + +# configure the build for cross-compiling and a known supported backend +do_configure_prepend() { + agg=False + tkagg=False + ignore_qt4=" --ignore tests/test_qt4.py" + ignore_qt5=" --ignore tests/test_qt5.py" + if ${@bb.utils.contains('PACKAGECONFIG', 'Agg', 'true', 'false', d)}; then + backend=Agg + agg=True + elif ${@bb.utils.contains('PACKAGECONFIG', 'Cairo', 'true', 'false', d)}; then + backend=Cairo + elif ${@bb.utils.contains('PACKAGECONFIG', 'Qt4Agg', 'true', 'false', d)}; then + backend=Qt4Agg + agg=True + ignore_qt4='' + elif ${@bb.utils.contains('PACKAGECONFIG', 'Qt5Agg', 'true', 'false', d)}; then + backend=Qt5Agg + agg=True + ignore_qt5='' + elif ${@bb.utils.contains('PACKAGECONFIG', 'TkAgg', 'true', 'false', d)}; then + backend=TkAgg + agg=True + tkagg=True + fi + cp ${S}/setup.cfg.template ${B}/setup.cfg + sed -i -e \ + "s:#basedirlist = /usr:basedirlist = ${STAGING_EXECPREFIXDIR}:g" \ + ${B}/setup.cfg +# matplotlib wants freetype v2.6.1 +# the following tries to download that version to build it +# sed -i -e "s:#local_freetype = False:local_freetype = True:g" ${B}/setup.cfg + sed -i -e "s:#tests = False:tests = True:g" ${B}/setup.cfg + sed -i -e "s:#agg = auto:agg = ${agg}:g" ${B}/setup.cfg + sed -i -e "s:#tkagg = auto:tkagg = ${tkagg}:g" ${B}/setup.cfg + sed -i -e "s:#backend = Agg:backend = ${backend}:g" ${B}/setup.cfg + echo "" >> ${B}/setup.cfg + echo "verbose = True" >> ${B}/setup.cfg +} + +RDEPENDS_${PN}-ptest += " \ + libagg \ + ${PN} \ + ${PYTHON_PN}-mock \ + ${PYTHON_PN}-nose \ + ${PYTHON_PN}-pytest \ +" + +addtask do_write_setup_cfg after do_configure before do_populate_lic + +inherit ptest + +do_install_ptest_prepend() { + sed -i -e "s:\@MATPLOTLIB_DIR\@:${MATPLOTLIB_DIR}:g" ${WORKDIR}/run-ptest + sed -i -e "s:\@MATPLOTLIB_DIR\@:${MATPLOTLIB_DIR}:g" ${WORKDIR}/pytest.ini +} + +do_install_ptest() { + install -m 0644 ${WORKDIR}/pytest.ini ${D}${MATPLOTLIB_DIR}/ +} + +FILES_${PN}-ptest += " \ + ${MATPLOTLIB_DIR}/sphinxext/tests \ + ${MATPLOTLIB_DIR}/tests \ + ${MATPLOTLIB_DIR}/testing \ +" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-python/recipes-devtools/python/python-matplotlib/pytest.ini b/meta-python/recipes-devtools/python/python-matplotlib/pytest.ini new file mode 100644 index 0000000000..746aa2d57c --- /dev/null +++ b/meta-python/recipes-devtools/python/python-matplotlib/pytest.ini @@ -0,0 +1,4 @@ +[pytest] +; test_agg.py test case 4 causes Out of Memory error on qemu +argopts = --ignore @MATPLOTLIB_DIR@/test_agg.py +; --ignore @MATPLOTLIB_DIR@/test_backend_pdf.py --ignore @MATPLOTLIB_DIR@/test_text.py diff --git a/meta-python/recipes-devtools/python/python-matplotlib/run-ptest b/meta-python/recipes-devtools/python/python-matplotlib/run-ptest new file mode 100644 index 0000000000..3015cd93e4 --- /dev/null +++ b/meta-python/recipes-devtools/python/python-matplotlib/run-ptest @@ -0,0 +1,2 @@ +#!/bin/sh +py.test @MATPLOTLIB_DIR@ --junit-xml matplotlib.xml diff --git a/meta-python/recipes-devtools/python/python-matplotlib_2.0.2.bb b/meta-python/recipes-devtools/python/python-matplotlib_2.0.2.bb deleted file mode 100644 index 5b1c3f05b9..0000000000 --- a/meta-python/recipes-devtools/python/python-matplotlib_2.0.2.bb +++ /dev/null @@ -1,18 +0,0 @@ -DESCRIPTION = "matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats" -SECTION = "devel/python" -LICENSE = "PSF" -LIC_FILES_CHKSUM = "file://LICENSE/LICENSE;md5=afec61498aa5f0c45936687da9a53d74" - -DEPENDS += "python-numpy freetype libpng python-dateutil python-pytz" -RDEPENDS_${PN} = "python-core python-distutils python-numpy freetype libpng python-dateutil python-pytz" - -SRC_URI = "https://github.com/matplotlib/matplotlib/archive/v${PV}.tar.gz \ - file://fix_setupext.patch \ -" -SRC_URI[md5sum] = "89717c1ef3c6fdcd6fb1f3b597a4858c" -SRC_URI[sha256sum] = "aebed23921562792b68b8ca355de5abc176af4424f1987e2fa95f65e5c5e7e89" -S = "${WORKDIR}/matplotlib-${PV}" -EXTRA_OECONF = "--disable-docs" - -inherit setuptools pkgconfig - diff --git a/meta-python/recipes-devtools/python/python-matplotlib_2.1.2.bb b/meta-python/recipes-devtools/python/python-matplotlib_2.1.2.bb new file mode 100644 index 0000000000..ba9700d03d --- /dev/null +++ b/meta-python/recipes-devtools/python/python-matplotlib_2.1.2.bb @@ -0,0 +1,4 @@ +require python-matplotlib.inc +inherit setuptools python-dir + +RDEPENDS_${PN} += "python-backports-functools-lru-cache python-functools32" diff --git a/meta-python/recipes-devtools/python/python3-matplotlib_2.1.2.bb b/meta-python/recipes-devtools/python/python3-matplotlib_2.1.2.bb new file mode 100644 index 0000000000..fd52622b0a --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-matplotlib_2.1.2.bb @@ -0,0 +1,2 @@ +inherit setuptools3 python3-dir +require python-matplotlib.inc -- cgit 1.2.3-korg