1 # Maintainer: Daniel M. Capella <polyzen@archlinux.org>
4 pkgname=python-stack-data
7 pkgdesc='Extract data from python stack frames and tracebacks for informative displays'
9 url=https://github.com/alexmojaki/stack_data
11 depends=('python-asttokens' 'python-executing' 'python-pure-eval')
12 makedepends=('python-build' 'python-installer' 'python-setuptools-scm'
14 checkdepends=('cython' 'python-littleutils' 'python-pygments' 'python-pytest')
15 source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz"
16 "$pkgname-update_test_pygments_example.patch::$url/commit/4fbe4c0aec04ac818070d5963b0249a5592c1b53.patch"
17 '0002-Patch-out-typeguard.patch')
18 sha256sums=('32d2dd0376772d01b6cb9fc996f3c8b57a357089dec328ed4b6553d037eaf815'
19 'e8946290f32855d91d64d4173fd254dceb9c1b6c397393b52e20fdccd867872a'
20 '35bd4d2b2227dd045185a9e979c067cfc1828197845633d23d670da59e8133a0')
21 b2sums=('1344b48a597af3df3a00036412c513faa97824f183a4337566a1a8efafcb6ec6597cf5fad3c6d532e8df2173900bdf87d0071efc66a801bd93743a92619fb5dd'
22 'ed6bedb214477fe99448ab7379834c7c49f932c3393d34023839951011279731bf6a310e3848a1ac8706573f2758697f25c4eaaf06aa704f10f1c31df5ac2254'
23 '9a996a0ff97930777fffd8f2626c0403098d0d3b211115c132e045b77e5506577aa392b94c3fb285be35a274455ec19eca9d1bf265bd29bc1e2e0cdd6cfb2fe5')
27 patch --forward --strip=1 --input=../$pkgname-update_test_pygments_example.patch
29 # Incompatible with typeguard >=3 https://github.com/alexmojaki/stack_data/issues/50
30 patch --forward --strip=1 --input=../0002-Patch-out-typeguard.patch
35 python -m build --wheel --skip-dependency-check --no-isolation
40 python -m venv --system-site-packages test-env
41 test-env/bin/python -m installer dist/*.whl
42 test-env/bin/python -m pytest
47 python -m installer --destdir="$pkgdir" dist/*.whl
49 # Symlink license file
50 local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
51 install -d "$pkgdir"/usr/share/licenses/$pkgname
52 ln -s "$site_packages"/$_name-$pkgver.dist-info/LICENSE.txt \
53 "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt