summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/trectools/default.nix
blob: b626e5d2bef145b655f8ce151998100886a943d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  beautifulsoup4,
  pandas,
  python,
  numpy,
  scikit-learn,
  scipy,
  lxml,
  matplotlib,
  sarge,
  unittestCheckHook,
  setuptools,
}:

buildPythonPackage {
  pname = "trectools";
  version = "0.0.50";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "joaopalotti";
    repo = "trectools";
    # https://github.com/joaopalotti/trectools/issues/41
    rev = "8a896def007e3d657eb29f820ee3de98e2f32691";
    hash = "sha256-p8BvLO+rD/l+ATE4+u3I6k25R1RVKlk2dn+RLQZTLDs=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace-fail "bs4 >= 0.0.0.1" "beautifulsoup4 >= 4.11.1"
  '';

  build-system = [ setuptools ];

  dependencies = [
    pandas
    numpy
    scikit-learn
    scipy
    lxml
    beautifulsoup4
    matplotlib
    sarge
  ];

  unittestFlagsArray = [
    "unittests/"
  ];

  nativeCheckInputs = [
    unittestCheckHook
  ];

  pythonImportsCheck = [ "trectools" ];

  meta = {
    homepage = "https://github.com/joaopalotti/trectools";
    description = "Library for assisting Information Retrieval (IR) practitioners with TREC-like campaigns";
    license = lib.licenses.bsdOriginal;
    maintainers = with lib.maintainers; [ MoritzBoehme ];
  };
}