# -*- 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           github 1.0
PortGroup           python 1.0

github.setup        huggingface transformers 4.21.2 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            0
name                py-${github.project}
categories-append   textproc

license             Apache-2
maintainers         nomaintainer
platforms           {darwin any}
supported_archs     noarch

description         State-of-the-art Natural Language Processing for \
                    TensorFlow 2.0 and PyTorch

long_description    Transformers provides thousands of pretrained \
                    models to perform tasks on texts such as \
                    classification, information extraction, question \
                    answering, summarization, translation, text \
                    generation, etc in 100+ languages. Its aim is to \
                    make cutting-edge NLP easier to use for everyone.

homepage            https://huggingface.co/transformers/

python.versions     39 310

checksums           rmd160  fcc0a020b12dd1cc2eedff7f63ca538a64eba388 \
                    sha256  3c0fb2162e24db7faf8807e591a6d7545e752ce54aa98aaa653eb1661a4d6789 \
                    size    10238764

if {${name} ne ${subport}} {
    python.pep517   yes

    depends_run-append \
                    port:py${python.version}-absl \
                    port:py${python.version}-conllu \
                    port:py${python.version}-cookiecutter \
                    port:py${python.version}-datasets \
                    port:py${python.version}-elasticsearch \
                    port:py${python.version}-fairseq \
                    port:py${python.version}-faiss \
                    port:py${python.version}-fastapi \
                    port:py${python.version}-fastprogress \
                    port:py${python.version}-filelock \
                    port:py${python.version}-fire \
                    port:py${python.version}-fugashi \
                    port:py${python.version}-h5py \
                    port:py${python.version}-huggingface_hub \
                    port:py${python.version}-importlib-metadata \
                    port:py${python.version}-keras2onnx \
                    port:py${python.version}-matplotlib \
                    port:py${python.version}-nltk \
                    port:py${python.version}-numpy \
                    port:py${python.version}-onnxconverter-common \
                    port:py${python.version}-Pillow \
                    port:py${python.version}-pandas \
                    port:py${python.version}-packaging \
                    port:py${python.version}-parameterized \
                    port:py${python.version}-protobuf3 \
                    port:py${python.version}-psutil \
                    port:py${python.version}-pydantic \
                    port:py${python.version}-pytorch \
                    port:py${python.version}-pytorch-lightning \
                    port:py${python.version}-recommonmark \
                    port:py${python.version}-regex \
                    port:py${python.version}-requests \
                    port:py${python.version}-sacrebleu \
                    port:py${python.version}-sacremoses \
                    port:py${python.version}-scikit-learn \
                    port:py${python.version}-seqeval \
                    port:py${python.version}-soundfile \
                    port:py${python.version}-sphinx \
                    port:py${python.version}-starlette \
                    port:py${python.version}-tensorboardX \
                    path:${python.pkgd}/tensorflow:py${python.version}-tensorflow-macos \
                    port:py${python.version}-tensorflow-datasets \
                    port:py${python.version}-timeout-decorator \
                    port:py${python.version}-tokenizers \
                    port:py${python.version}-torchaudio \
                    port:py${python.version}-torchtext \
                    port:py${python.version}-torchvision \
                    port:py${python.version}-tqdm \
                    port:py${python.version}-unidic \
                    port:py${python.version}-unidic-lite \
                    port:py${python.version}-uvicorn

    if {${python.version} eq 310} {
        depends_run-replace \
                    path:${python.pkgd}/tensorflow:py${python.version}-tensorflow \
                    path:${python.pkgd}/tensorflow:py${python.version}-tensorflow-macos
    }

    depends_test-append \
                    port:py${python.version}-huggingface_hub \
                    port:py${python.version}-pytest-sugar \
                    port:py${python.version}-pytest-xdist

    # https://github.com/huggingface/transformers/issues/4857
    conflicts-append \
                    py${python.version}-sentencepiece

    test.run        yes

    livecheck.type  none
}
