summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e34b09204668d5d86531dac99a4bf31ab5a1f950 (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
54
55
# Maintainer: Astro Benzene <universebenzene at sina dot com>
# Contributor: Marcell Meszaros < marcell.meszaros AT runbox.eu >
# Contributor: Andres Alejandro Navarro Alsina <aanavarroa@unal.edu.co>
# Contributor: Dan Foreman-Mackey

pkgname='python-emcee-git'
_basename="${pkgname%-git}"
_distname="${_basename#python-}"
pkgver=3.1.4.dev6+gc3164ce
pkgrel=1
pkgdesc='The Python ensemble sampling toolkit for affine-invariant MCMC'
arch=('any')
url="https://pypi.org/project/${_distname}"
_repourl="https://github.com/dfm/${_distname}"
license=('MIT')
depends=('python-numpy')
makedepends=('git'
             'python-setuptools-scm'
             'python-build'
             'python-installer'
             'python-wheel')
checkdepends=('python-pytest'
              'python-h5py'
              'python-scipy')
optdepends=('python-tqdm: For progress bars'
            'python-h5py: For HDF5 backend'
            'python-scipy'
            'python-emcee-doc: Documentations for emcee')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("${_basename}::git+${_repourl}.git")
b2sums=('SKIP')

pkgver() {
    cd "${_basename}"
    printf "%s" "$(git describe --long --tags | sed 's/\([^-]*\)-g/dev\1+g/;s/-/./g;s/^v//')"
}

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

check() {
    #python -c 'import emcee; emcee.test()'
    cd "${_basename}"
    pytest -v || warning 'Tests failed' # -vv --color=yes
}

package() {
    cd "${_basename}"
    python -m installer --destdir="${pkgdir}" dist/*.whl
    install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
    install -Dm644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}"
}