summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fa278ee3baf549786490abedc6d370263e42ecc6 (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
# 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.0
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-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=("https://github.com/executablebooks/MyST-NB/archive/refs/tags/v${pkgver}.tar.gz")
#       'Makefile')
md5sums=('5f46bd0e3a4f38e94be9c31df789aa98')

#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:${PYTHONPATH}" pytest || 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=('python-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}"
#}