# -*- 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-setuptools_scm
version             7.0.5
revision            1
categories-append   devel
license             MIT
supported_archs     noarch
platforms           {darwin any}

# keep version for PY27 and PY34, these are (indirect) dependencies of py-virtualenv
python.versions     27 34 35 36 37 38 39 310 311
python.pep517       yes

maintainers         {stromnov @stromnov} openmaintainer

description         Package to manage versions by scm tags.
long_description    {*}${description}

homepage            https://github.com/pypa/setuptools_scm/

checksums           rmd160  802b485ebe66e71f6ad9263fa71feff595ccb1b1 \
                    sha256  031e13af771d6f892b941adb6ea04545bbf91ebc5ce68c78aaf3fff6e1fb4844 \
                    size    70716

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

    if {${python.version} eq 34} {
        version             3.5.0
        revision            0
        checksums           rmd160  4c63618354c506cb64dd75bd1ca605d00342c1ce \
                            sha256  5bdf21a05792903cafe7ae0c9501182ab52497614fa6b1750d9dbae7b60c1a87 \
                            size    46272
        python.pep517       no
    } elseif {${python.version} in "27 35"} {
        version             5.0.2
        revision            0
        checksums           rmd160  9a479a8c63f12ea4a07714e5a8f11a6b918f8d48 \
                            sha256  83a0cedd3449e3946307811a4c7b9d89c4b5fd464a2fb5eeccd0a5bb158ae5c8 \
                            size    52273
        python.pep517       no
    } elseif {${python.version} eq 36} {
        version             6.4.2
        revision            0
        checksums           rmd160  6876656de603d15079102abf2f9ed18f2937f7db \
                            sha256  6833ac65c6ed9711a4d5d2266f8024cfa07c533a0e55f4c12f6eff280a5a9e30 \
                            size    61305
        python.pep517       no
        depends_lib-append  port:py${python.version}-packaging \
                            port:py${python.version}-tomli
    } else {
        depends_lib-append  port:py${python.version}-packaging \
                            port:py${python.version}-typing_extensions
        if {${python.version} < 38} {
            depends_lib-append  port:py${python.version}-importlib-metadata
        }

        # Puthon-3.11 has tomllib, anyway requires tomli to be installed
        # It should be restricted to <311 after the next release
        # See: https://github.com/pypa/setuptools_scm/pull/748
        depends_lib-append  port:py${python.version}-tomli
    }

    # https://trac.macports.org/ticket/57199
    use_configure       yes
    configure.cmd       ${python.bin}
    configure.pre_args
    configure.args      setup.py egg_info

    livecheck.type      none
}
