summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e8bca7a36f646e31fabd89a07fced687e3cfb208 (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
40
41
42
43
44
45
46
47
48
49
50
# Maintainer: Luis Martinez <luis dot martinez at disroot dot org>

pkgname=python-configurationutil
_name=configurationutil
pkgver=3.7.6
pkgrel=2
pkgdesc="Collection of state machine utilities"
arch=('any')
url='https://pypi.org/project/configurationutil'
license=('custom:PSF')
depends=(
	'python-appdirs'
	'python-classutils'
	'python-fdutil'
	'python-future'
	'python-jsonschema'
	'python-logging-helper'
	'python-pyyaml'
	'python-uiutil')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
# checkdepends=('python-logging-helper' 'python-classutils' 'python-timingsutil')
source=("$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/c/$_name/$_name-$pkgver.tar.gz")
sha256sums=('a413f35ea4a6d0530b778d101f00065eab16a68216ecb930699a950ded8a8ea0')

prepare() {
	cd "$_name-$pkgver"
	sed -i "/packages=/s/()/(exclude=['*unittests*'])/" setup.py
}

build() {
	cd "$_name-$pkgver"
	python -m build --wheel --no-isolation
}

## FIXME: tests missing test data
# check() {
# 	cd "$_name-$pkgver"
# 	python -m unittest discover
# }

package() {
	cd "$_name-$pkgver"
	PYTHONHASHSEED=0 python -m installer --destdir="$pkgdir/" dist/*.whl

	local _site="$(python -c 'import site; print(site.getsitepackages()[0])')"
	install -d "$pkgdir/usr/share/licenses/$pkgname/"
	ln -s \
		"$_site/$_name-$pkgver.dist-info/LICENSE.txt" \
		"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}