# -*- 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

github.setup        jenisys parse_type 0.6.0 v
revision            0
name                py-parse-type

categories-append   devel
supported_archs     noarch
platforms           {darwin any}
license             BSD
maintainers         nomaintainer

description         parse_type extends the parse module\
                    (opposite of string.format())

long_description    parse_type extends the parse module (opposite of\
                    string.format()) with the following features:\
                    build type converters for common use cases\
                    (enum/mapping, choice)\; build a type converter\
                    with a cardinality constraint (0..1,0..*,1..*)\;\
                    from the type converter with cardinality=1.\;\
                    compose a type converter from other type\
                    converters\; an extended parser that supports the\
                    CardinalityField naming schema and creates missing\
                    type variants (0..1,0..*,1..*) from the primary\
                    type converter

checksums           rmd160  b2f35344037fc0b3266023caf208fde787f225fb \
                    sha256  ba5b948b73155c7910a41d8215c99622b78b2824afb5e1532c3e8bcf4235f3cc \
                    size    272777

python.versions     37 38 39

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

    depends_run-append \
                    port:py${python.version}-parse \
                    port:py${python.version}-six

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

    test.run        yes
    test.cmd        py.test-${python.branch}
    test.args       -o addopts=''
    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.rst LICENSE \
            ${destroot}${docdir}
    }
}
