# -*- 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
PortGroup           select 1.0

name                py-pylint
version             3.3.8
revision            0

categories-append   devel
platforms           {darwin any}
license             GPL-2+
supported_archs     noarch

python.versions     310 311 312 313

maintainers         {stromnov @stromnov} openmaintainer

description         Error (and style) checking for python

long_description    Pylint is a tool that checks for errors in python code, \
                    and tries to check that a given coding standard \
                    is respected by the coders. This is similar but \
                    nevertheless different from what pychecker_ provides, \
                    especially since pychecker explicitely does not bother \
                    with coding style. The default coding style used \
                    by pylint is close to `Guido's style guide`_.

homepage            https://pylint.org

checksums           rmd160  e64f9e66bee1b72bd255c82d05bb67e79c9d32c7 \
                    sha256  26698de19941363037e2937d3db9ed94fb3303fdadf7d98847875345a8bb6b05 \
                    size    1523947

if {${name} ne ${subport}} {
    depends_lib-append  port:py${python.version}-dill \
                        port:py${python.version}-platformdirs \
                        port:py${python.version}-astroid \
                        port:py${python.version}-isort \
                        port:py${python.version}-tomlkit \
                        port:py${python.version}-flake8-mccabe

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

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

    depends_run-append  port:pylint_select

    post-destroot {
        xinstall -m 0755 -d ${destroot}${prefix}/share/doc/${subport}
        if {[file exists ${worksrcpath}/doc]} {
            xinstall -m 0644 {*}[glob -types f ${worksrcpath}/doc/*] \
                ${destroot}${prefix}/share/doc/${subport}
            if {[file exists ${worksrcpath}/doc/_static]} {
                xinstall -m 0755 -d ${destroot}${prefix}/share/doc/${subport}/_static
                xinstall -m 0644 {*}[glob -types f ${worksrcpath}/doc/_static/*] \
                    ${destroot}${prefix}/share/doc/${subport}/_static
            }
        }
        file delete ${destroot}${python.pkgd}/logilab/__init__.py
    }

    select.group    pylint
    select.file     ${filespath}/pylint${python.version}

    notes "
To make the Python ${python.branch} version of pylint the one that is run\
when you execute the commands without a version suffix, e.g. 'pylint', run:

port select --set ${select.group} [file tail ${select.file}]
"
}
