summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: bc39fe2dfbcfe1b873f703abbbdb44a527910c37 (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: Astro Benzene <universebenzene at sina dot com>
# Maintainer: Ista Zahn <istazahn at gmail dot com>

pkgname=python-fast-histogram
_pyname=fast_histogram
pkgver=0.14
pkgrel=1
pkgdesc="Fast 1D and 2D histogram functions in Python"
arch=('i686' 'x86_64')
url="https://github.com/astrofrog/fast-histogram"
license=('BSD-2-Clause')
makedepends=('python-setuptools-scm'
             'python-wheel'
             'python-build'
             'python-installer'
             'python-numpy')
checkdepends=('python-pytest'
              'python-hypothesis')
source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz")
sha256sums=('390973b98af22bda85c29dcf6f008ba0d626321e9bd3f5a9d7a43e5690ea69ea')

get_pyver() {
    python -c "import sys; print('$1'.join(map(str, sys.version_info[:2])))"
}

build() {
    cd ${srcdir}/${_pyname}-${pkgver}

    python -m build --wheel --no-isolation --skip-dependency-check
}

check() {
    cd ${srcdir}/${_pyname}-${pkgver}
    pytest "build/lib.linux-${CARCH}-cpython-$(get_pyver)" || warning "Tests failed" # -vv -l -ra --color=yes -o console_output_style=count \
#       --deselect=build/lib.linux-${CARCH}-cpython-$(get_pyver)/fast_histogram/tests/test_histogram.py::test_1d_compare_with_numpy \
#       --deselect=build/lib.linux-${CARCH}-cpython-$(get_pyver)/fast_histogram/tests/test_histogram.py::test_2d_compare_with_numpy \
#       --deselect=build/lib.linux-${CARCH}-cpython-$(get_pyver)/fast_histogram/tests/test_histogram.py::test_dd_compare_with_numpy #|| warning "Tests failed" # -vv -l -ra --color=yes -o console_output_style=count
}

package() {
    depends=('python-numpy')
    cd "${srcdir}/${_pyname}-${pkgver}"

    python -m installer --destdir="${pkgdir}" dist/*.whl
    install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    install -Dm 644 README.rst "${pkgdir}/usr/share/doc/${pkgname}/README"
}