# -*- 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-future
version             0.18.2
revision            0

categories-append   devel
platforms           darwin
supported_archs     noarch
license             MIT
maintainers         {petr @petrrr} openmaintainer

description         Provides clean single-source support for Python 3 and 2
long_description    \
    The Python package future is the missing compatibility layer between \
    Python 3 and Python 2. It allows you to use a single, clean Python \
    3.x-compatible codebase to support both Python 3 and Python 2 with \
    minimal overhead. The futurize script aids in converting code from \
    either Python 2 or Python 3 to code compatible with both platforms.

homepage            https://python-future.org/
master_sites        pypi:[string index ${python.rootname} 0]/${python.rootname}
distname            ${python.rootname}-${version}

checksums           rmd160  d728505628b12cd395e4f8efead19ae61479a49d \
                    sha256  b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d \
                    size    829220

python.versions     27 35 36 37 38 39

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

    post-destroot {
        set dest_doc ${destroot}${prefix}/share/doc/${subport}
        xinstall -d  ${dest_doc}
        xinstall -m 0644 -W ${worksrcpath} README.rst \
            LICENSE.txt ${dest_doc}
        copy {*}[glob ${worksrcpath}/docs/*.py] ${dest_doc}
        copy {*}[glob ${worksrcpath}/docs/*.rst] ${dest_doc}
    }

    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
}
