# Maintainer: Yauhen Kirylau # Maintainer: Padraic Fanning # Maintainer: nomisge _name=gaphas pkgname=python-${_name} pkgver=4.0.0 pkgrel=1 pkgdesc="Diagramming widget library for Python" arch=('any') url="https://github.com/gaphor/${_name}" license=('Apache') depends=( 'gtk4' 'python-gobject' 'python-cairo' 'python-importlib-metadata' ) makedepends=( 'python-build' 'python-installer' 'python-poetry-core' ) checkdepends=( 'python-pytest' 'python-sphinx' 'python-pytest-archon' 'python-pytest-xvfb' 'xorg-server-xvfb' ) source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz") sha256sums=('1d46584e72e265bb3499b530945a43b81a4dbab3a46493573a727321d22b67ba') build() { cd "${_name}-${pkgver}" # Note: set `GIT_CEILING_DIRECTORIES` to prevent poetry # from incorrectly using a parent git checkout info. # https://github.com/pypa/build/issues/384#issuecomment-947675975 GIT_CEILING_DIRECTORIES="${PWD}/.." python -m build --wheel --no-isolation } check() { cd "${srcdir}/${_name}-${pkgver}" export TEST_GTK_VERSION='4.0' local python_version=$(python -c 'import sys; print("".join(map(str, sys.version_info[:2])))') echo "$python_version" # NOTE: this command will segfault because test_guide.py can't run headless # python -m pytest -s tests xvfb-run --auto-servernum python -m pytest -s tests } package() { cd "${_name}-${pkgver}" python -m installer --destdir="$pkgdir" dist/*.whl }