# -*- 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-importlib-resources
python.rootname     importlib_resources
version             6.1.2
revision            0

platforms           {darwin any}
supported_archs     noarch
license             PSF
maintainers         {@rdbisme gmail.com:rubendibattista} openmaintainer

description         A backport of Python standard library importlib.resources module for \
                    Python 2.7, and 3.4 through 3.8.
long_description    {*}${description}

homepage            https://importlib-resources.readthedocs.io

checksums           rmd160  30c72f5568b7e4b7dc76179089e19eb3fc96c0f4 \
                    sha256  308abf8474e2dba5f867d279237cd4076482c3de7104a40b41426370e891549b \
                    size    38932

# keep version for Python 2.7, which is an (indirect) dependency of py-virtualenv
# See <https://trac.macports.org/wiki/Python#VersionPolicy>
python.versions     27 310 311 312 313

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

    if {${python.version} == 27} {
        version     3.3.1
        revision    0
        checksums   rmd160  6b0e6b482a5cb45430243e78317731efcf7eb84b \
                    sha256  0ed250dbd291947d1a298e89f39afcc477d5a6624770503034b72588601bcc05 \
                    size    29012

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

        depends_lib-append \
                    port:py${python.version}-contextlib2 \
                    port:py${python.version}-pathlib2 \
                    port:py${python.version}-singledispatch \
                    port:py${python.version}-typing
    } elseif {${python.version} == 36} {
        version     5.4.0
        revision    0
        checksums   md5 ef86f9f1bb77958b171afaafbedf6c91 \
                    rmd160 e39417855078deb5372174671f86475ed0b51339 \
                    sha256 d756e2f85dd4de2ba89be0b21dba2a3bbec2e871a42a3a16719258a11f87506b
    } elseif {${python.version} == 37} {
        version     5.12.0
        revision    0
        checksums   md5 5457c25b89b19fcaca8af03e541dfa41 \
                    rmd160 2ad7c7831391d8701209bc85da8b16f4c388d816 \
                    sha256 4be82589bf5c1d7999aedf2a45159d10cb3ca4f19b2271f8792bc8e6da7b22f6
    }

    if {${python.version} < 310} {
        depends_lib-append \
                    port:py${python.version}-zipp
    }

    test.run        yes
    test.cmd        ${python.bin} -m unittest discover
    test.target

    livecheck.type  none
}
