# -*- 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-autoflake
version             2.3.1
revision            0
license             MIT
platforms           {darwin any}
supported_archs     noarch
maintainers         nomaintainer

description         Removes unused imports and unused variables
long_description    {*}${description}

homepage            https://github.com/PyCQA/autoflake

checksums           rmd160  ac35ba45a6ece9c32604d3717954432e9a1d624f \
                    sha256  c98b75dc5b0a86459c4f01a1d32ac7eb4338ec4317a4469515ff1e687ecd909e \
                    size    27642

python.versions     310 311 312 313

python.pep517_backend   hatch

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

    if {${python.version} < 311} {
        depends_lib-append \
                    port:py${python.version}-tomli
    }

    post-destroot {
        set docdir ${destroot}${prefix}/share/doc/${subport}
        set doc_list [list LICENSE README.md]
        xinstall -d ${docdir}
        foreach f ${doc_list} {
            xinstall -m 644 -W ${worksrcpath} ${f} ${docdir}
            file delete -force ${destroot}/${python.pkgd}/${f}
        }
    }
}
