# -*- 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-pytest
version             9.0.3
revision            0

categories-append   devel
platforms           {darwin any}
supported_archs     noarch
license             MIT
maintainers         {reneeotten @reneeotten} openmaintainer

description         py.test: simple powerful testing with Python
long_description    The pytest framework makes it easy to write small tests, \
                    yet scales to support complex functional testing \
                    for applications and libraries.

homepage            https://pytest.org

checksums           rmd160  33dab24ac7e0e12b65b8db0af88c73db5c51465c \
                    sha256  b86ada508af81d19edeb213c681b1d48246c1a91d304c6c81a427674c17eb91c \
                    size    1572165

python.versions     27 310 311 312 313 314

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

    depends_lib-append  port:py${python.version}-iniconfig \
                        port:py${python.version}-packaging \
                        port:py${python.version}-pluggy \
                        port:py${python.version}-pygments

    if {${python.version} == 310} {
        depends_lib-append \
                        port:py${python.version}-exceptiongroup \
                        port:py${python.version}-tomli
    }

    if {${python.version} == 27} {
        version         4.6.3
        revision        1
        distname        ${python.rootname}-${version}
        checksums       rmd160  5d88707bd2fc29ee675087b24461a9ca8cbe1ffb \
                        sha256  4a784f1d4f2ef198fe9b7aef793e9fa1a3b2f84e822d9b3a64a181293a572d45 \
                        size    949947

        depends_lib-delete  port:py${python.version}-iniconfig \
                            port:py${python.version}-pygments

        depends_lib-append \
                            port:py${python.version}-atomicwrites \
                            port:py${python.version}-attrs \
                            port:py${python.version}-funcsigs \
                            port:py${python.version}-importlib-metadata \
                            port:py${python.version}-more-itertools \
                            port:py${python.version}-packaging \
                            port:py${python.version}-pathlib2 \
                            port:py${python.version}-pluggy \
                            port:py${python.version}-py \
                            port:py${python.version}-setuptools \
                            port:py${python.version}-six \
                            port:py${python.version}-wcwidth
    }

    depends_run         port:pytest_select

    select.group        pytest
    select.file         ${filespath}/pytest${python.version}
    notes-append "
To make the Python ${python.branch} version of pytest the one that is run\
when you execute the commands without a version suffix, e.g. 'pytest', run:

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

    livecheck.type      none
}
