# -*- 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-argh
version             0.28.1
revision            0

platforms           {darwin any}
supported_archs     noarch
license             LGPL-3+
maintainers         {petr @petrrr} {@catap korins.ky:kirill} openmaintainer

description         A simple argparse wrapper
long_description    {*}${description}

homepage            https://github.com/neithere/${python.rootname}

checksums           rmd160  1cb54b238d0e1b2d9162e180caa3de25299bb430 \
                    sha256  b2093086f0e809a3ecc24b64a2145309ee8f56d034936cd59e57c558a357329d \
                    size    62511

python.pep517           yes
python.pep517_backend   flit

python.versions     27 37 38 39 310 311

if {${name} ne ${subport}} {
    if {${python.version} <= 37} {
        version             0.27.2
        revision            0
        checksums           rmd160  7cf930c37fd08d7d842af0a53d8135371db7a41c \
                            sha256  00c9027f6f461bcf24afe599a281bbda5cbd5dee4b6705befbea293a4ca7d221 \
                            size    49200

        python.pep517       no

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

    if {${python.version} >= 37} {
        depends_test-append \
                        port:py${python.version}-pytest \
                        port:py${python.version}-mock \
                        port:py${python.version}-iocapture

        test.run        yes
        test.cmd        py.test-${python.branch}

        # https://github.com/neithere/argh/issues/148#issuecomment-981508602
        test.args       --deselect test/test_integration.py::test_invalid_choice \
                        --deselect test/test_integration.py::test_explicit_cmd_name

        test.target
        test.env        PYTHONPATH=${worksrcpath}/build/lib
    }

    livecheck.type  none
}
