# -*- 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-dill
version             0.4.0
revision            0

platforms           {darwin any}
supported_archs     noarch
license             BSD

maintainers         {petr @petrrr} {reneeotten @reneeotten} openmaintainer

description         serialize all of python extends python's pickle module
long_description    \
    dill extends python's pickle module for serializing and de-serializing \
    python objects to the majority of the built-in python types. It provides \
    the user the same interface as the pickle module, and also includes some \
    additional features. In addition to pickling python objects, dill \
    provides the ability to save the state of an interpreter session in a \
    single command.

homepage            https://github.com/uqfoundation/dill

checksums           rmd160  7149839f9290182bb49a1f36b5f14778e95f8e5b \
                    sha256  0633f1d2df477324f53a895b02c901fb961bdbf65a17122586ea7019292cbcf0 \
                    size    186976

python.versions     39 310 311 312 313

if {${name} ne ${subport}} {
    # make sure the tests are run with the correct Python version
    post-patch {
        reinplace "s|python = 'python'|python = '${python.bin}'|g" \
            ${worksrcpath}/dill/tests/__main__.py
    }

    test.run        yes
    depends_test    port:py${python.version}-numpy

    python.test_framework
    test.dir        ${build.dir}/dill/tests
    test.cmd        ${python.bin} __main__.py

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath} LICENSE README.md \
            ${destroot}${docdir}
    }
}
