# -*- 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-watchdog
version             2.1.3
revision            0

categories-append   sysutils
platforms           darwin
license             Apache-2
maintainers         {petr @petrrr} openmaintainer

description         Python API and shell utilities to monitor file system events.
long_description    ${description}

homepage            https://github.com/gorakhargosh/watchdog

checksums           sha256  e5236a8e8602ab6db4b873664c2d356c365ab3cac96fbdec4970ad616415dd45 \
                    rmd160  35e87a0fbc23837e172b09afe6e257df0285003e \
                    size    109053

python.versions     27 35 36 37 38 39

if {${name} ne ${subport}} {
    if {${python.version} < 36} {
        version     0.10.7
        revision    0
        checksums   sha256  50cb861700b99edcb4b7af330d28ce34ba5551a74b51c0a283ed221e936435f4 \
                    rmd160  73748d31a104982a71a2329288e0b6bcef92f90d \
                    size    102622
        depends_lib-append  port:py${python.version}-pathtools
    }

    depends_lib-append      port:py${python.version}-argh \
                            port:py${python.version}-setuptools \
                            port:py${python.version}-yaml

    if {${os.major} <= 10} {
        patchfiles  patch.osx-10.6.setup.py
    }

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

    depends_test-append \
                    port:py${python.version}-flaky \
                    port:py${python.version}-pytest

    test.run        yes
    test.cmd        py.test-${python.branch}
    test.args       -o addopts=''
    test.target

    livecheck.type  none
}
