# -*- 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-coverage
version             7.10.3
revision            0

categories-append   devel
maintainers         {petr @petrrr} {reneeotten @reneeotten} openmaintainer
license             Apache-2

description         Code coverage measurement for Python
long_description    Coverage measures code coverage, typically during test \
                    execution. It uses the code analysis tools and tracing \
                    hooks provided in the Python standard library to \
                    determine which lines are executable, and which have \
                    been executed.

homepage            https://github.com/nedbat/coveragepy

checksums           rmd160  e51af0eb2f81ee6189d2c4bf82611cddb7593bbe \
                    sha256  812ba9250532e4a823b070b0420a36499859542335af3dca8f47fc6aa1a05619 \
                    size    822936

python.versions     39 310 311 312 313

if {${name} ne ${subport}} {
    patchfiles      patch-setup.py.diff

    post-patch {
        reinplace "s|coverage run|coverage-${python.branch} run|g" {*}[glob ${worksrcpath}/tests/*.py]
        reinplace "s|\"coverage\"|\"coverage-${python.branch}\"|g" ${worksrcpath}/tests/coveragetest.py
    }

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath} README.rst NOTICE.txt \
            LICENSE.txt CONTRIBUTORS.txt CHANGES.rst \
            ${destroot}${docdir}
    }
}
