# -*- 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-numdifftools
version             0.9.41
revision            1

categories-append   math
platforms           {darwin any}
supported_archs     noarch
license             BSD
maintainers         {reneeotten @reneeotten} openmaintainer

description         Solve automatic numerical differentiation problems in one or more variables.
long_description    {*}${description}

homepage            https://github.com/pbrod/numdifftools

checksums           rmd160  b0e5c5f14cedd13472d209ff6649d098dff65d3b \
                    sha256  4ef705cd3c06211b3a4e9fd05ad622be916dcfda40732f0128805a2c4be389b4 \
                    size    6735932

python.versions     310 311 312 313

if {${name} ne ${subport}} {
    patch.pre_args-replace  -p0 -p1
    patchfiles      patch-NumPy-v2-compatibility.diff

    # remaining issue with complex numbers for derivatives
    # see: https://github.com/pbrod/numdifftools/issues/72

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

    depends_lib-append  port:py${python.version}-algopy \
                        port:py${python.version}-numpy \
                        port:py${python.version}-scipy \
                        port:py${python.version}-statsmodels

    test.run            yes

    depends_test-append port:py${python.version}-hypothesis \
                        port:py${python.version}-matplotlib \
                        port:py${python.version}-line_profiler

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath} LICENSE.txt \
            README.rst ${destroot}${docdir}
    }
}
