# -*- 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-pydantic
version             2.13.4
revision            0

categories-append   devel
license             MIT

python.versions     310 311 312 313 314

maintainers         {@jandemter demter.de:jan} openmaintainer

description         Data validation and settings management using Python type hinting
long_description    Fast and extensible, pydantic plays nicely \
                    with your linters/IDE/brain. Define how data \
                    should be in pure, canonical Python 3.6+\; \
                    validate it with pydantic.

homepage            https://github.com/samuelcolvin/pydantic

checksums           rmd160  ce6d66291ef89f9916884f5ce8daa2916e76db13 \
                    sha256  c40756b57adaa8b1efeeced5c196f3f3b7c435f90e84ea7f443901bec8099ef6 \
                    size    844775

set pydantic_darwin_min_ver 13

if {${name} ne ${subport}} {
    if {${os.platform} eq "darwin" && ${os.major} < ${pydantic_darwin_min_ver}} {
        # Notice, this is not a version peg, as of now;
        # branch 1.x is still being updated.
        version     1.10.26
        revision    0
        checksums   rmd160  e380273a0cc2abbf48ab14c203674218f34d7285 \
                    sha256  8c6aa39b494c5af092e690127c283d84f363ac36017106a9e66cb33a22ac412e \
                    size    357906

        depends_build-append \
                    port:py${python.version}-cython \
                    port:py${python.version}-pythran
    } else {
        supported_archs     noarch
        platforms           {darwin any}

        python.pep517_backend \
                    hatch

        depends_build-append \
                    port:py${python.version}-hatch-fancy-pypi-readme

        depends_run-append \
                    port:py${python.version}-annotated_types \
                    port:py${python.version}-pydantic_core \
                    port:py${python.version}-typing-inspection
    }

    depends_run-append \
                    port:py${python.version}-typing_extensions

    livecheck.type  none
}
