summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e8d487f27c5c303268845dc8d07df265b18d1e2d (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
51
52
53
# Maintainer: Eric Langlois <eric@langlois.xyz>
pkgname=python-akro
_name=${pkgname#python-}
pkgver=0.0.8
pkgrel=1
pkgdesc="Spaces types for reinforcement learning"
arch=('any')
url="https://github.com/rlworkgroup/akro"
license=('MIT')
depends=(
	'python'
	'python-gym'
	'python-numpy'
)
optdepends=()
makedepends=('python-setuptools')
checkdepends=(
	'python-pytest'
	'python-pytest-cov'
	'python-pytest-xdist'
)
source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz"
        "$_name-fix-test-imports.patch")
sha256sums=('4fc0dc1acf35db19b39a209e20ce14dc8197723c73d3adf3ba7f8cdc1dbf6e58'
            '7fa5b22dec473c540c9962143ab90f6dbf3487f1909b7aa7cdd2d34fb7e2343d')

prepare() {
	cd "$_name-$pkgver"
	patch -p1 -i "$srcdir/$_name-fix-test-imports.patch"
}

build() {
	cd "$_name-$pkgver"
	python setup.py build
}

check() {
	cd "$_name-$pkgver/build/lib"
	# Test excludes:
	#   _tf: Requires tensorflow < 2, a large dependency
	#   _theano: Requires theano, a large dependency
	#   test_hash: Python hashes are not reproducible...
	#   TestBox::test_invalid_env: Tests gym.Box.__init__, and gym's error
	#       seems to have changed from what they expected.
	python -m pytest "$srcdir/$_name-$pkgver/tests" \
		-k 'not _tf and not _theano and not test_hash and not test_invalid_env'
}

package() {
	cd "$_name-$pkgver"
	python setup.py install --root="$pkgdir" --optimize=1 --skip-build
	install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}