# -*- 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-pypdf
version             6.1.0
revision            0

categories-append   devel
platforms           {darwin any}
supported_archs     noarch
license             BSD
maintainers         {reneeotten @reneeotten} openmaintainer

description         A utility to read and write pdfs with Python
long_description    A Pure-Python PDF toolkit. It is capable of \
                    extracting document information, splitting \
                    documents page by page, merging documents page \
                    by page, cropping pages, merging multiple pages \
                    into a single page, and encrypting and \
                    decrypting PDF files.

homepage            https://github.com/py-pdf/pypdf

checksums           rmd160  0d547cc620b07e3ae1ba55795b801711d712fdc7 \
                    sha256  0cba440d024da5a2a9304f03cd645346052827b84c5a461c6123e24ed5a3b0b9 \
                    size    5072609

python.versions     39 310 311 312 313
python.pep517_backend   flit

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

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

    depends_test-append \
                    port:py${python.version}-pytest-timeout \
                    port:py${python.version}-yaml
    test.run        yes

    # Don't run tests that rely on test data not included in the distfile.
    test.args       -o addopts="-m 'not enable_socket and not samples'"
}
