Commit a6649da9 authored by happysalada's avatar happysalada Committed by Yt
Browse files

python310Packages.sacrebleu: init at 2.3.1

parent 0ed682c3
Loading
Loading
Loading
Loading
+68 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchFromGitHub

# Propagated build inputs
, portalocker
, regex
, tabulate
, numpy
, colorama
, lxml

# Check inputs
, pytestCheckHook
}:
let
  pname = "sacrebleu";
  version = "2.3.1";
in
buildPythonPackage {
  inherit pname version;
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "mjpost";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-+58dhQv5LkjccjktfoAG2gqja6TMLIxHIbRgzZPDhKo=";
  };

  # postPatch = ''
  #   substituteInPlace setup.py \
  #     --replace "portalocker==" "portalocker>="
  # '';

  propagatedBuildInputs = [
    portalocker
    regex
    tabulate
    numpy
    colorama
    lxml
  ];

  checkInputs = [
    pytestCheckHook
  ];

  disabledTestPaths = [
    # require network access
    "test/test_api.py"
    "test/test_dataset.py"
  ];

  preCheck = ''
    export HOME=$(mktemp -d)
  '';

  pythonImportsCheck = [ "sacrebleu" ];

  meta = with lib; {
    description = "Hassle-free computation of shareable, comparable, and reproducible BLEU, chrF, and TER scores";
    homepage = "https://github.com/mjpost/sacrebleu";
    changelog = "https://github.com/mjpost/sacrebleu/blob/v{version}/CHANGELOG.md";
    license = licenses.asl20;
    maintainers = with maintainers; [ happysalada ];
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -11037,6 +11037,8 @@ self: super: with self; {

  sacn = callPackage ../development/python-modules/sacn { };

  sacrebleu = callPackage ../development/python-modules/sacrebleu { };

  sacremoses = callPackage ../development/python-modules/sacremoses { };

  safe = callPackage ../development/python-modules/safe { };