# -*- 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-tiktoken
version             0.13.0
revision            0

categories-append   devel
license             MIT
maintainers         {wholezero.org:macports @mrdomino} openmaintainer

description         tiktoken is a fast BPE tokeniser for use with OpenAI's models
long_description    {*}${description}

homepage            https://github.com/openai/tiktoken

checksums           ${distname}${extract.suffix} \
                    rmd160  515c8f94398245a501c2729df5f989c17bad7fe1 \
                    sha256  c9435714c3a84c2319499de9a300c0e604449dd0799ff246458b3bb6a7f433c1 \
                    size    38986

python.versions     311 312 313 314

if {${name} ne ${subport}} {
    PortGroup       rust 1.0

    depends_build-append \
                    port:py${python.version}-setuptools-rust \
                    port:py${python.version}-wheel

    depends_lib-append \
                    port:py${python.version}-regex \
                    port:py${python.version}-requests

    test.run        yes
    test.env-append PYTHONPATH=${destroot}${python.pkgd}
    test.target     tests/*
    test.args-append \
                    --deselect=tests/test_misc.py::test_optional_blobfile_dependency \
                    --deselect=tests/test_simple_public.py::test_optional_blobfile_dependency
    test.post_args  --import-mode=append

    depends_test-append \
                    port:py${python.version}-hypothesis

    # cd ${worksrcpath}
    # sudo cargo update
    # egrep -e '^(name|version|checksum) = ' Cargo.lock | perl -pe 's/^(?:name|version|checksum) = "(.+)"/$1/' | tr '\n' ' ' | perl -pe 's|([0-9a-f]{64})|\1 \\\n|g' | pbcopy
    cargo.crates \
        aho-corasick 1.1.4 ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301 \
        bit-set 0.8.0 08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3 \
        bit-vec 0.8.0 5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7 \
        bstr 1.12.1 63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab \
        fancy-regex 0.17.0 72cf461f865c862bb7dc573f643dd6a2b6842f7c30b07882b56bd148cc2761b8 \
        heck 0.5.0 2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea \
        libc 0.2.186 68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66 \
        memchr 2.8.0 f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79 \
        once_cell 1.21.4 9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50 \
        portable-atomic 1.13.1 c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49 \
        proc-macro2 1.0.106 8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934 \
        pyo3 0.28.3 91fd8e38a3b50ed1167fb981cd6fd60147e091784c427b8f7183a7ee32c31c12 \
        pyo3-build-config 0.28.3 e368e7ddfdeb98c9bca7f8383be1648fd84ab466bf2bc015e94008db6d35611e \
        pyo3-ffi 0.28.3 7f29e10af80b1f7ccaf7f69eace800a03ecd13e883acfacc1e5d0988605f651e \
        pyo3-macros 0.28.3 df6e520eff47c45997d2fc7dd8214b25dd1310918bbb2642156ef66a67f29813 \
        pyo3-macros-backend 0.28.3 c4cdc218d835738f81c2338f822078af45b4afdf8b2e33cbb5916f108b813acb \
        quote 1.0.45 41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924 \
        regex 1.12.3 e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276 \
        regex-automata 0.4.14 6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f \
        regex-syntax 0.8.10 dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a \
        rustc-hash 2.1.2 94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe \
        serde 1.0.228 9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e \
        serde_core 1.0.228 41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad \
        serde_derive 1.0.228 d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79 \
        syn 2.0.117 e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99 \
        target-lexicon 0.13.5 adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca \
        unicode-ident 1.0.24 e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75
}
