# -*- 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-apache-beam
version             2.29.0
platforms           darwin
license             Apache-2
maintainers         nomaintainer

description         Apache Beam SDK for Python
long_description    Apache Beam is a unified model for defining both \
                    batch and streaming data-parallel processing \
                    pipelines, as well as a set of language-specific \
                    SDKs for constructing pipelines and Runners for \
                    executing them on distributed processing backends, \
                    including Apache Apex, Apache Flink, Apache Spark, \
                    Google Cloud Dataflow and Hazelcast Jet.

homepage            https://beam.apache.org
use_zip             yes
distname            ${python.rootname}-${version}

checksums           rmd160  17d8562354de39c91b1eb9fbbc4d795e242761a2 \
                    sha256  b53363cc2e7ad9cfb1dc916c88678d3d78c9c4d4943e7d9887a0248ca790398d \
                    size    2455770

python.versions     39

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

    depends_run-append \
                    port:py${python.version}-avro \
                    port:py${python.version}-crcmod \
                    port:py${python.version}-dateutil \
                    port:py${python.version}-dill \
                    port:py${python.version}-fastavro \
                    port:py${python.version}-grpcio \
                    port:py${python.version}-grpcio-tools \
                    port:py${python.version}-hdfs \
                    port:py${python.version}-httplib2 \
                    port:py${python.version}-mock \
                    port:py${python.version}-numpy \
                    port:py${python.version}-pip \
                    port:py${python.version}-pyarrow \
                    port:py${python.version}-pymongo \
                    port:py${python.version}-oauth2client \
                    port:py${python.version}-protobuf3 \
                    port:py${python.version}-pydot \
                    port:py${python.version}-tz

    depends_test-append \
                    port:py${python.version}-freezegun \
                    port:py${python.version}-future \
                    port:py${python.version}-nose \
                    port:py${python.version}-nose_xunitmp \
                    port:py${python.version}-pandas \
                    port:py${python.version}-parameterized \
                    port:py${python.version}-pyhamcrest \
                    port:py${python.version}-pytest \
                    port:py${python.version}-pytest-xdist \
                    port:py${python.version}-requests-mock \
                    port:py${python.version}-tenacity \
                    port:py${python.version}-yaml

    if { ${python.version} == 37 } {
        depends_run-append \
                    port:py${python.version}-typing_extensions
    }

    # Fix permissions
    post-extract {
        fs-traverse d_or_f ${worksrcpath} {
            if { [file isfile ${d_or_f}] } {
                file attributes ${d_or_f} -permissions o+r
            } elseif { [file isdirectory ${d_or_f}] } {
                file attributes ${d_or_f} -permissions o+rx
            }
        }
    }

    pre-test {
        test.env-append \
                    PYTHONPATH=[glob -nocomplain ${build.dir}/build/lib*]
    }

    test.run        yes
    test.cmd        py.test-${python.branch}
    test.target

    livecheck.type      none
}
