summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 798347ea81fd83f5fc8e078ba0a2f75eec5e85c8 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Maintainer: Astro Benzene <universebenzene at sina dot com>
# Maintainer: Ista Zahn <istazahn@gmail.com>

pkgbase=python-glue-core
_pname=${pkgbase#python-}
_pyname=${_pname//-/_}
pkgname=("python-${_pname}" "python-${_pname}-doc")
pkgver=1.21.1
pkgrel=1
pkgdesc="Core library for the glue multidimensional data visualization project"
arch=('any')
url="http://glueviz.org"
license=('BSD-3-Clause')
makedepends=('python-setuptools-scm'
             'python-wheel'
             'python-build'
             'python-installer'
             'python-sphinx-automodapi'
             'python-sphinx-book-theme'
             'python-numpydoc'
             'python-astropy'
             'python-echo'
             'python-matplotlib'
             'python-mpl-scatter-density'
             'python-pandas'
             'python-scipy'
             'python-shapely'
             'ipython')
checkdepends=('python-pytest-mpl'
#             'python-pytest-xdist'
              'python-astrodendro'
              'python-dask'
              'python-openpyxl'
              'python-pyavm'
              'python-scikit-image'
              'python-xlrd')  # matplotlib pandas echo astropy ipython shapely scipy already in makedepends, fast-histogram <- mpl-scatter-density; h5py <- astrodendro
source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz")
sha256sums=('b66e73fcdcf78e159ec686b13a7c8f1b4542e5cab46416aa5f1a1cdd4c42baf6')

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

    msg "Building Docs"
    ln -rs ${srcdir}/${_pyname}-${pkgver}/${_pyname/-/_}*egg-info \
        build/lib/${_pyname/-/_}-${pkgver}-py$(get_pyver .).egg-info
    PYTHONPATH="../build/lib" make -C doc html
}

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

    pytest || warning "Tests failed" # -vv -l -ra --color=yes -o console_output_style=count -p xdist -n 4
}

package_python-glue-core() {
    depends=('python>=3.8'
             'python-numpy>=1.17'
             'python-matplotlib>=3.2'
             'python-scipy>=1.1'
             'python-pandas>=1.2'
             'python-echo>=0.6'
             'python-astropy>=4.0'
             'python-setuptools>=30.3.0'
             'ipython>=4.0'
             'python-dill>=0.2'
             'python-h5py>=2.10'
             'python-xlrd>=1.2'
             'python-openpyxl>=3.0'
             'python-shapely>=2.0'
             'python-mpl-scatter-density>=0.7')
    optdepends=('python-glue-qt: Qt GUI of glue'
                'python-astrodendro: for dendrograms'
                'python-pyavm: for reading AVM metadata'
                'python-spectral-cube: for reading spectral cubes'
                'python-scikit-image: highly recommended and domain-independent'
                'python-glue-core-doc: Documentation for glue-core'
                'glueviz-doc: Documentation for glueviz')
    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"
}

package_python-glue-core-doc() {
    pkgdesc="Documentation for Glue core library"
    cd ${srcdir}/${_pyname}-${pkgver}/doc/_build

    install -D -m644 -t "${pkgdir}/usr/share/licenses/${pkgname}" ../../LICENSE
    install -d -m755 "${pkgdir}/usr/share/doc/${pkgbase}"
    cp -a html "${pkgdir}/usr/share/doc/${pkgbase}"
}