summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e14ac99d90ae37a88c85a1e95d096a9315df7805 (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
# Maintainer: Iyán Méndez Veiga <me (at) iyanmv (dot) com>
_pkgname=qiskit-optimization
pkgname=python-$_pkgname
pkgver=0.6.1
pkgrel=2
pkgdesc="Quantum Optimization package for IBM qiskit framework"
arch=(any)
url=https://github.com/qiskit-community/qiskit-optimization
license=(Apache-2.0)
depends=(
    python-docplex
    python-networkx
    python-numpy
    python-qiskit
    python-qiskit-algorithms
    python-scipy
)
makedepends=(
    python-build
    python-installer
    python-setuptools
    python-wheel
)
checkdepends=(
    python-ddt
    python-pytest
    python-qiskit-aer
)
source=($_pkgname-$pkgver.tar.gz::https://github.com/qiskit-community/$_pkgname/archive/$pkgver.tar.gz)
b2sums=('b0796d1e3822ea05753634bcc9ff9f0d203a30aa58ed79052e3316beb405d191126269cdf762ae99a45b3f09bd49519962c18c0d65f0660a93b2bd7db2a7e867')

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

check() {
    cd $_pkgname-$pkgver
    local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
    python -m installer --destdir=../test_dir dist/*.whl
    PYTHONPATH=../test_dir/$_site_packages pytest
}

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