# -*- 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             2.7.2
revision            0
categories-append   devel
platforms           darwin
license             GPL-2+
supported_archs     noarch

python.versions     27 35 36 37 38 39

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  4693521135ca4f13dbc88c3c609a56f0648d7455 \
                    sha256  0e21d3b80b96740909d77206d741aa3ce0b06b41be375d92e1f3244a274c1f8a \
                    size    709177

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

    depends_lib-append  port:py${python.version}-setuptools \
                        port:py${python.version}-astroid \
                        port:py${python.version}-isort \
                        port:py${python.version}-flake8-mccabe \
                        port:py${python.version}-toml

    if {${python.version} eq 27} {
        version             1.9.4
        revision            0
        distname            ${python.rootname}-${version}
        checksums           rmd160  763a56b52da567df22a09caa965da3e15dccbd9a \
                            sha256  ee1e85575587c5b58ddafa25e1c1b01691ef172e139fc25585e5d3f02451da93 \
                            size    519076

        depends_lib-append  port:py${python.version}-configparser \
                            port:py${python.version}-backports-functools_lru_cache \
                            port:py${python.version}-singledispatch \
                            port:py${python.version}-six
        depends_lib-delete  port:py${python.version}-toml
    }

    if {${python.version} == 35} {
        version             2.6.2
        revision            0
        distname            ${python.rootname}-${version}
        checksums           rmd160  0244d65adb569dc35ccf3215576d5579162690bb \
                            sha256  718b74786ea7ed07aa0c58bf572154d4679f960d26e9641cc1de204a30b87fc9 \
                            size    680364
    }

    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
            }
        }
        xinstall -m 0644 -W ${worksrcpath} ChangeLog README.rst \
            ${destroot}${prefix}/share/doc/${subport}
        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}]
"

    livecheck.type      none
}
