# -*- 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.11.7
revision            0

categories-append   devel
license             MIT

python.versions     39 310 311 312 313

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  581e4df04a4c411a81973a1ba85fab7644c7bfcd \
                    sha256  d989c3c6cb79469287b1569f7447a17848c998458d49ebe294e975b9baf0f0db \
                    size    788350

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.22
        revision    0
        checksums   rmd160  ea9251e86e52b98e63a71ff8e63ce69edf641c8c \
                    sha256  ee1006cebd43a8e7158fb7190bb8f4e2da9649719bff65d0c287282ec38dec6d \
                    size    356771

        depends_build-append \
                    port:py${python.version}-cython \
                    port:py${python.version}-pythran

        livecheck.type      none

    } 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
}
