# -*- 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           github 1.0

github.setup        dbr tvdb_api 2.0
revision            0
name                py-tvdb

categories-append   net
platforms           darwin
supported_archs     noarch
license             public-domain
maintainers         nomaintainer

description         An easy to use API interface to TheTVDB.com
long_description    ${description}

checksums           rmd160  e36c246fdd0ad5f4955caec3d1374c1983490562 \
                    sha256  15849f43fb29bb34f12ca539572720c256e35f93cb72664be13076a6bfe227f1 \
                    size    32202

python.versions     27 35 36 37 38

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

    depends_lib-append \
                    port:py${python.version}-requests \
                    port:py${python.version}-requests-cache

    post-extract {
        reinplace "s|'${version}-dev'|'${version}'|g" ${worksrcpath}/setup.py
    }

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

    test.run        yes
    test.cmd        py.test-${python.branch}
    test.target
    test.env        PYTHONPATH=${worksrcpath}/build/lib

    livecheck.type  none
}
