summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 57906e45735fb15548ce27fafc390ab6b2b51066 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Maintainer: BrainDamage
pkgname="python-wfdb"
pkgver=4.1.2
_basename='wfdb-python'
_dirname="${_basename}-${pkgver}"
pkgrel=2
pkgdesc="Library of tools for reading, writing, and processing WFDB signals and annotations"
arch=(any)
url="https://github.com/MIT-LCP/wfdb-python"
license=("MIT")
depends=("python" "python-numpy" "python-scipy" "python-matplotlib" "python-pandas" "python-requests" "python-soundfile")
sha256sums=('c96c62b8abede8c0987c77d49285c923f114787a96d110cf95dac5e5d56360cd')
source=("https://github.com/MIT-LCP/${_basename}/archive/v${pkgver}.tar.gz")

makedepends=('python-build' 'python-installer' 'python-wheel' 'python-poetry' 'python-sphinx')
checkdepends=('python-pytest' 'python-pytest-xdist' 'python-pylint' 'python-black')

build() {
	cd "${srcdir}/${_dirname}"
	export PYTHONHASHSEED=0
	python -m build --wheel --no-isolation
	cd docs
	make html
}

package() {
	cd "${srcdir}/${_dirname}"
	find dist -name '*.whl' -exec python -m installer --compile-bytecode 1 --destdir="${pkgdir}" {} \;
	# not necessary for every package, but for those who it is, it'd generate conflict with others otherwise
	rm -rf "${pkgdir}/$(python -c 'import site; print(site.getsitepackages()[0])')/tests/"
	find docs/_build/html -type f -exec install -Dvm 644 {} -t "${pkgdir}/usr/share/doc/${_basename}/html" \;
	find . -maxdepth 1 -iname 'README*' -exec install -Dvm 644 {} -t "${pkgdir}/usr/share/doc/${_basename}" \;
	find . -maxdepth 1 -iname 'LICENSE*' -exec install -Dvm 644 {} -t "${pkgdir}/usr/share/licenses/${_basename}" \;
}

check() {
	cd "${srcdir}/${_dirname}"
	pytest -n auto
}