# -*- 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-opentelemetry-sdk
version             1.45.3
revision            0

categories-append   devel
platforms           {darwin any}
supported_archs     noarch
license             Apache-2
maintainers         nomaintainer

description         OpenTelemetry Python SDK
long_description    {*}${description}

homepage            https://github.com/open-telemetry/opentelemetry-python/tree/main/opentelemetry-sdk

distname            opentelemetry_sdk-${version}

checksums           rmd160  d15f3473ffba3a19e27c98c93cff85502878a96e \
                    sha256  59c446f0e5468b6b009abc6b256514a19fab8f1e57c876b21f7576392979c37e \
                    size    221701

python.versions     313 314 315
python.pep517_backend hatch

if {${name} ne ${subport}} {
    depends_lib-append \
                    port:py${python.version}-opentelemetry-api \
                    port:py${python.version}-opentelemetry-semantic-conventions \
                    port:py${python.version}-typing_extensions

    test.run        yes
    depends_test-append \
                    port:py${python.version}-flaky \
                    port:py${python.version}-opentelemetry-test-utils \
                    port:py${python.version}-psutil

    # tests/trace/test_trace.py::TestTracer::test_shutdown runs the
    # 'python' found on PATH; make that this subport's Python, not whatever
    # 'port select python' points at.
    pre-test {
        xinstall -d ${workpath}/test-bin
        ln -sf ${python.bin} ${workpath}/test-bin/python
    }
    test.env-append PATH=${workpath}/test-bin:$env(PATH)
}
