1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 pythonRelaxDepsHook,
7 cookiecutter,
8 datasets,
9 dill,
10 fsspec,
11 huggingface-hub,
12 importlib-metadata,
13 multiprocess,
14 numpy,
15 packaging,
16 pandas,
17 pyarrow,
18 requests,
19 responses,
20 tqdm,
21 xxhash,
22}:
23
24buildPythonPackage rec {
25 pname = "evaluate";
26 version = "0.4.1";
27 format = "setuptools";
28
29 disabled = pythonOlder "3.7";
30
31 src = fetchFromGitHub {
32 owner = "huggingface";
33 repo = pname;
34 rev = "refs/tags/v${version}";
35 hash = "sha256-axcJg0ZalEd4FOySCiFReKL7wmTCtLaw71YqyLHq8fc=";
36 };
37
38 nativeBuildInputs = [ pythonRelaxDepsHook ];
39 pythonRelaxDeps = [ "responses" ];
40
41 propagatedBuildInputs = [
42 cookiecutter
43 datasets
44 numpy
45 dill
46 pandas
47 requests
48 tqdm
49 xxhash
50 multiprocess
51 fsspec
52 huggingface-hub
53 packaging
54 pyarrow
55 responses
56 ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
57
58 # most tests require internet access.
59 doCheck = false;
60
61 pythonImportsCheck = [ "evaluate" ];
62
63 meta = with lib; {
64 homepage = "https://huggingface.co/docs/evaluate/index";
65 description = "Easily evaluate machine learning models and datasets";
66 changelog = "https://github.com/huggingface/evaluate/releases/tag/v${version}";
67 license = licenses.asl20;
68 maintainers = with maintainers; [ bcdarwin ];
69 mainProgram = "evaluate-cli";
70 };
71}