2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# Propagated build inputs
|
|
|
|
portalocker,
|
|
|
|
regex,
|
|
|
|
tabulate,
|
|
|
|
numpy,
|
|
|
|
colorama,
|
|
|
|
lxml,
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# Check inputs
|
|
|
|
pytestCheckHook,
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
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
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
checkInputs = [ pytestCheckHook ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
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";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "sacrebleu";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://github.com/mjpost/sacrebleu";
|
|
|
|
changelog = "https://github.com/mjpost/sacrebleu/blob/v{version}/CHANGELOG.md";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ happysalada ];
|
|
|
|
};
|
|
|
|
}
|