# -*- 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
PortGroup           github 1.0

github.setup        computationalmodelling nbval 0.9.4
revision            0
name                py-${github.project}
categories-append   science

platforms           darwin
supported_archs     noarch

license             BSD

maintainers         nomaintainer

description         A py.test plugin to validate Jupyter notebooks

long_description    The plugin adds functionality to py.test to\
                    recognise and collect Jupyter notebooks. The\
                    intended purpose of the tests is to determine\
                    whether execution of the stored inputs match the\
                    stored outputs of the .ipynb file. Whilst also\
                    ensuring that the notebooks are running without\
                    errors.

checksums           rmd160  bf0abeaeabc194bfac27ddc69a14f8ae4c98e7ca \
                    sha256  b5376203118884de370916a03bc346e238ccac9513b5f67391af3f0888b79f43 \
                    size    62097

python.versions     27 35 36 37 38 39

if {${name} ne ${subport}} {

    depends_build-append \
        port:py${python.version}-setuptools

    depends_run-append \
        port:py${python.version}-coverage \
        port:py${python.version}-ipykernel \
        port:py${python.version}-jupyter_client \
        port:py${python.version}-nbformat \
        port:py${python.version}-pytest \
        port:py${python.version}-six

    depends_test-append \
        port:py${python.version}-matplotlib \
        port:py${python.version}-pytest-cov \
        port:py${python.version}-sympy

    post-patch {
        reinplace "s|\"py.test\"|\"py.test-${python.branch}\"|g" \
            ${worksrcpath}/tests/test_unit_tests_in_notebooks.py
    }

    test.run        yes
    test.cmd        py.test-${python.branch}
    test.target     tests
    test.env        PYTHONPATH=${worksrcpath}/build/lib

    livecheck.type  none
}
