{% set name = "sacrebleu" %}
{% set version = "2.4.3" %}

package:
  name: {{ name|lower }}
  version: {{ version }}

source:
  url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
  sha256: e734b1e0baeaea6ade0fefc9d23bac3df50bf15775d8b78edc108db63654192a

build:
  number: 0
  script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
  entry_points:
    - sacrebleu = sacrebleu.sacrebleu:main
  # Skip 3.12 for missing portalocker
  skip: true  # [py<38 or py>311]

requirements:
  host:
    - python
    - pip
    - setuptools
    - wheel
  run:
    - python
    - typing
    - portalocker
    - regex
    - tabulate >=0.8.9
    - numpy >=1.17
    - colorama
    - lxml
  run_constrained:
    - ipadic >=1.0,<2.0
    - mecab-python3 >=1.0.9,<2.0.0
    - mecab-ko >=1.0.0,<=1.0.1
    - mecab-ko-dic >=1.0,<2.0

test:
  source_files:
    - test
  imports:
    - sacrebleu
    - sacrebleu.dataset
    - sacrebleu.metrics
    - sacrebleu.tokenizers
  requires:
    - pip
    - pytest
  commands:
    - pip check
    {% set tests_to_skip = "process_to_text" %}
    {% set tests_to_skip = tests_to_skip + " or api_get_source or api_get_reference" %}  # [win]
    - pytest test -k "not ({{ tests_to_skip }})"

about:
  home: https://github.com/mjpost/sacrebleu
  license: Apache-2.0
  license_family: Apache
  license_file: LICENSE.txt
  summary: Reference BLEU implementation that auto-downloads test sets and reports a version string to facilitate cross-lab comparisons
  doc_url: https://github.com/mjpost/sacrebleu/blob/master/README.md
  dev_url: https://github.com/mjpost/sacrebleu

  description: |
    SacreBLEU (Post, 2018) provides hassle-free computation of shareable,
    comparable, and reproducible BLEU scores. Inspired by Rico Sennrich's
    multi-bleu-detok.perl, it produces the official WMT scores but works with
    plain text. It also knows all the standard test sets and handles
    downloading, processing, and tokenization for you.

extra:
  recipe-maintainers:
    - hmaarrfk
