1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4
5# Propagated build inputs
6, portalocker
7, regex
8, tabulate
9, numpy
10, colorama
11, lxml
12
13# Check inputs
14, pytestCheckHook
15}:
16let
17 pname = "sacrebleu";
18 version = "2.3.1";
19in
20buildPythonPackage {
21 inherit pname version;
22 format = "setuptools";
23
24 src = fetchFromGitHub {
25 owner = "mjpost";
26 repo = pname;
27 rev = "v${version}";
28 hash = "sha256-+58dhQv5LkjccjktfoAG2gqja6TMLIxHIbRgzZPDhKo=";
29 };
30
31 # postPatch = ''
32 # substituteInPlace setup.py \
33 # --replace "portalocker==" "portalocker>="
34 # '';
35
36 propagatedBuildInputs = [
37 portalocker
38 regex
39 tabulate
40 numpy
41 colorama
42 lxml
43 ];
44
45 checkInputs = [
46 pytestCheckHook
47 ];
48
49 disabledTestPaths = [
50 # require network access
51 "test/test_api.py"
52 "test/test_dataset.py"
53 ];
54
55 preCheck = ''
56 export HOME=$(mktemp -d)
57 '';
58
59 pythonImportsCheck = [ "sacrebleu" ];
60
61 meta = with lib; {
62 description = "Hassle-free computation of shareable, comparable, and reproducible BLEU, chrF, and TER scores";
63 homepage = "https://github.com/mjpost/sacrebleu";
64 changelog = "https://github.com/mjpost/sacrebleu/blob/v{version}/CHANGELOG.md";
65 license = licenses.asl20;
66 maintainers = with maintainers; [ happysalada ];
67 };
68}