# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           python 1.0

name                py-bqscales
version             0.3.7
revision            0

license             Apache-2
maintainers         {mps @Schamschula} openmaintainer
description         Grammar of Graphics in Python for bqplot and other Jupyter widgets \
                    libraries
long_description    {*}${description}
homepage            https://github.com/bqplot/bqscales

checksums           rmd160  cad0389b4e777c44dfaf3cac1643685b421fe393 \
                    sha256  061488c68efba046ba166bbb9f87c8908c93b0bbe1a4636c36ca680553a121c1 \
                    size    393410

python.versions     310 311 312 313 314

python.pep517_backend \
                    hatch

if {${name} ne ${subport}} {
    depends_build-append  \
                    port:py${python.version}-hatch \
                    port:py${python.version}-hatch-jupyter-builder \
                    port:py${python.version}-hatch-nodejs-version \
                    port:py${python.version}-hatch-build-scripts \
                    port:py${python.version}-jupyterlab

    depends_lib-append  \
                    port:py${python.version}-ipywidgets \
                    port:py${python.version}-jupyterlab_pygments \
                    port:py${python.version}-numpy \
                    port:py${python.version}-traitlets \
                    port:py${python.version}-traittypes

    patchfiles      patch-package.json.diff \
                    patch-pyproject.toml.diff
    
    post-patch {
        reinplace "s/%PYVERSION%/${python.branch}/g" \
            ${worksrcpath}/package.json \
            ${worksrcpath}/pyproject.toml 
    }
}
