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

epoch               1
# Don't upgrade past py-spaCy's highest supported version.
github.setup        explosion catalogue 2.0.1 v
revision            0

checksums           rmd160  ccd56e7f6c290562783787c67d2efe9cd3e325a7 \
                    sha256  8ea3c49075982858a35cbe42d3c5bfdc386a8dc2d7265aa95b8acefc9603bfb6 \
                    size    9024

name                py-${github.project}
categories-append   devel
platforms           darwin
supported_archs     noarch
license             MIT
maintainers         nomaintainer

description         Super lightweight function registries for your library
long_description    catalogue is a tiny, zero-dependencies library\
                    that makes it easy to add function (or object)\
                    registries to your code. Function registries are\
                    helpful when you have objects that need to be both\
                    easily serializable and fully\
                    customizable. Instead of passing a function into\
                    your object, you pass in an identifier name, which\
                    the object can use to lookup the function from the\
                    registry. This makes the object easy to serialize,\
                    because the name is a simple string. If you\
                    instead saved the function, you'd have to use\
                    Pickle for serialization, which has many drawbacks.

python.versions     35 36 37 38 39

if {${name} ne ${subport}} {
    depends_build-append \
                    port:py${python.version}-setuptools

    if {${python.version} < 38} {
        depends_build-append \
                    port:py${python.version}-importlib-metadata
    }

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

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

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

    livecheck.type  none
}
