summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2e594c07536ad0168148f0c54553ad5a1e603eca (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Maintainer: Astro Benzene <universebenzene at sina dot com>
pkgbase=python-myst-nb
_pname=${pkgbase#python-}
_pyname=MyST-NB
#_pyname=${_pname//-/_}
pkgname=("python-${_pname}")
pkgver=1.1.2
pkgrel=1
pkgdesc="Parse and execute ipynb files in Sphinx"
arch=('any')
url="https://myst-nb.readthedocs.io"
license=('BSD-3-Clause')
makedepends=('python-flit-core'
             'python-build'
             'python-installer')
#            'python-sphinx-copybutton'
#            'python-sphinx_design'
#            'python-sphinx-book-theme'
#            'python-myst-parser'
#            'python-jupyter-cache'
#            'ipython'
#            'jupyter-nbformat')    # needs coconut
checkdepends=('python-pytest-param-files'
              'python-pytest-regressions'
#             'python-pytest-xdist'
              'python-beautifulsoup4'
#             'python-importlib-metadata'
              'python-ipywidgets'
              'python-jupyter-cache'
              'python-matplotlib'
              'python-myst-parser'
              'python-nbdime'
              'python-pandas'
              'python-sphinx'
              'python-sympy'
              'jupyter-nbconvert'
              'python-jupytext')
#checkdepends=('python-nose' 'python-myst-parser' 'python-jupyter-cache' 'ipython')
# nbformat importlib-metadata <- jupyter-cache
#checkdepends=('python-jupyter-sphinx' 'python-jupyter-cache' 'jupyter-nbconvert' 'python-yaml' 'python-sphinx-togglebutton')
#source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz")
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/executablebooks/MyST-NB/archive/refs/tags/v${pkgver}.tar.gz")
#       'Makefile')
md5sums=('ebca42bf36b65e6fefbb40fdab2a67a7')

#prepare() {
#    cd ${srcdir}/${_pyname}-${pkgver}
#
#    ln -s ${srcdir}/Makefile docs
#}

build() {
    cd ${srcdir}/${_pyname}-${pkgver}
    python -m build --wheel --no-isolation

#   msg "Building Docs"
#   mkdir -p dist/lib
#   bsdtar -xpf dist/${_pname/-/_}-${pkgver}-py3-none-any.whl -C dist/lib
#   PYTHONPATH="../dist/lib" make -C docs html
}

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

    mkdir -p dist/lib
    bsdtar -xpf dist/${_pname/-/_}-${pkgver}-py3-none-any.whl -C dist/lib
    PYTHONPATH="dist/lib" pytest || warning "Tests failed" # -vv -l -ra --color=yes -o console_output_style=count -p xdist -n 4
#   PYTHONPATH="dist/lib:${PYTHONPATH}" pytest -vv -l -ra --color=yes -o console_output_style=count #|| warning "Tests failed" # -vv -l -ra --color=yes -o console_output_style=count
#       --deselect=tests/test_execute.py::test_custom_convert_auto \
#       --deselect=tests/test_execute.py::test_custom_convert_cache
}

package_python-myst-nb() {
    depends=('python-importlib-metadata'
             'ipython'
             'python-jupyter-cache>=0.5'
#            'python-jupyter-sphinx'
             'python-myst-parser>=1.0.0'
             'jupyter-nbclient'     # depends on nbformat
             'python-sphinx>=5'
             'python-yaml'
             'python-typing_extensions'
             'python-ipykernel')
    optdepends=('pre-commit: code_style'
                'python-alabaster: rtd'
                'python-altair: rtd'
                'python-bokeh: rtd'
                'coconut-lang: rtd'
                'python-jupytext: rtd'
                'python-matplotlib: rtd'
                'python-numpy: rtd'
                'python-pandas: rtd'
                'python-plotly: rtd'
                'python-sphinx-book-theme: rtd'
                'python-sphinx-copybutton: rtd'
                'python-sphinx-panels: rtd'
                'python-sphinx_design: rtd'
                'python-sphinxcontrib-bibtex: rtd'
                'python-sympy: rtd')
    cd ${srcdir}/${_pyname}-${pkgver}

    install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
    install -D -m644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
    python -m installer --destdir="${pkgdir}" dist/*.whl
}

#package_python-sphinx-tabs-doc() {
#    pkgdesc="Documentation for Sphinx-Gallery extension"
#    cd ${srcdir}/${_pyname}-${pkgver}/doc/_build
#
#    install -d -m755 "${pkgdir}/usr/share/doc/${pkgbase}"
#    cp -a html "${pkgdir}/usr/share/doc/${pkgbase}"
#}