1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-23 03:05:48 +03:00
aports/community/py3-matplotlib/APKBUILD
psykose b71032c356 */*: invoke -m venv with --without-pip
we never use pip in the venv manually made for tests-
this might break 1-2 things unexpectedly, but

- those should be looked at anyway
- this has a severe speedup- even on a desktop machine with nvme, this
  makes an arbitrary venv go from 2.6s to <100ms(!) to make. a nice small
  optimisation.
2023-02-09 22:55:20 +01:00

92 lines
2.8 KiB
Text

# Contributor: Isaac Dunham <ibid.ag@gmail.com>
# Maintainer: Aiden Grossman <agrossman154@yahoo.com>
pkgname=py3-matplotlib
_pyname=matplotlib
pkgver=3.6.3
pkgrel=0
pkgdesc="Python3 library for plots"
url="https://matplotlib.org"
arch="all"
license="Python-2.0"
depends="
py3-cairo
py3-certifi
py3-contourpy
py3-cycler
py3-dateutil
py3-fonttools
py3-kiwisolver
py3-numpy
py3-packaging
py3-parsing
py3-pillow
py3-tz
python3-tkinter
"
makedepends="
freetype-dev
gfortran
libpng-dev
py3-gpep517
py3-numpy-dev
py3-setuptools
py3-setuptools_scm
py3-wheel
python3-dev
qhull-dev
tk-dev
"
checkdepends="
font-opensans
py3-pytest
py3-pytest-xdist
"
source="https://github.com/matplotlib/$_pyname/archive/v$pkgver/matplotlib-v$pkgver.tar.gz
$pkgname-images-$pkgver.tar.gz::https://github.com/boomanaiden154/matplotlib-test-images/releases/download/matplotlib-$pkgver/matplotlib-images.tar.gz
freetype.patch
test.patch
"
builddir="$srcdir/$_pyname-$pkgver"
replaces="py-matplotlib" # Backwards compatibility
provides="py-matplotlib=$pkgver-r$pkgrel" # Backwards compatibility
prepare() {
default_prepare
# Use system freetype and qhull
sed -e 's|#system_freetype = False|system_freetype = True|' -e 's|#system_qhull = False|system_qhull = True|' mplsetup.cfg.template > mplsetup.cfg
# Install tests
sed -i 's|#tests = False|tests = True|' mplsetup.cfg
# Copy images from freetype mpl images repo
cp -r ../matplotlib-images/matplotlib-$CARCH/* lib/matplotlib/tests/baseline_images/
cp -r ../matplotlib-images/mpl_toolkits-$CARCH/* lib/matplotlib/tests/baseline_images/
}
build() {
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
gpep517 build-wheel \
--wheel-dir dist \
--output-fd 3 3>&1 >&2
}
check() {
python3 -m venv --clear --without-pip --system-site-packages test-env
test-env/bin/python3 -m installer dist/*.whl
test-env/bin/python3 -m pytest -n $JOBS -v --pyargs matplotlib -m "not (nonfunctional or $CARCH)"
}
package() {
python3 -m installer --destdir="$pkgdir" dist/*.whl
# Remove tests from installation
rm -r "$pkgdir"/usr/lib/python3*/site-packages/matplotlib/tests/
rm -r "$pkgdir"/usr/lib/python3*/site-packages/mpl_toolkits/tests/
}
sha512sums="
6f7cf6e9ff69f473716d754b1b239ed9e0805ba688971a46ceb707474ad8da55af5616a6a07a14e1a2a016cc66a289469f1ed7ca7cd6bec588f8768f14db237e matplotlib-v3.6.3.tar.gz
4ea79c403bcbd6bbec0f6638863b593d33669db428c09f131b35c3673d066d0236a3dae8abd501a6feb0fb7631e09b38afba646e9872574202df868e81eda570 py3-matplotlib-images-3.6.3.tar.gz
ea21b9ac0253253b657c542e31f3c8dc3161419d7c42aa92036b98338a27b59d1cc5d7f699c8cbaf0302f63a4f730301044a8d11cdee8f9fb8027a80a12a394b freetype.patch
514b8017e4f132d9c6973e7596980465c2a491e11c08205046e2b87684e1f6dd34e095b50c979ea200f4e3f966e54d67009d6bdd9b7346008fd996c6c1eece50 test.patch
"