# -*- 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-natsort
version             7.1.1
revision            0

platforms           darwin
supported_archs     noarch
license             MIT
maintainers         {reneeotten @reneeotten} openmaintainer

description         Natural sorting for Python
long_description    When you try to sort a list of strings that \
                    contain numbers, the normal Python sort algorithm \
                    sorts lexicographically, so you might not get the \
                    results that you expect. `natsort` provides \
                    a function `natsorted` that helps sort lists \
                    'naturally', either as real numbers (i.e. \
                    signed/unsigned floats or ints), or as versions.

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

checksums           rmd160  c2fcbd5905f516d0458aaa13fd58b475985c471d \
                    sha256  00c603a42365830c4722a2eb7663a25919551217ec09a243d3399fa8dd4ac403 \
                    size    142749

python.versions     27 36 37 38 39

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

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

    if {${python.version} == 27} {
        version     6.2.1
        revision    0
        distname    ${python.rootname}-${version}
        checksums   rmd160  79f2de364df9c25343a213dab0ee5eb681b35b51 \
                    sha256  c5944ffd2343141fa5679b17991c398e15105f3b35bb11beefe66c67e08289d5 \
                    size    141650
    } else {
        depends_test-append \
                        port:py${python.version}-hypothesis \
                        port:py${python.version}-pytest \
                        port:py${python.version}-pytest-mock

        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.rst LICENSE \
            CHANGELOG.md ${destroot}${docdir}
    }

    livecheck.type  none
}
