about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/trectools/default.nix
blob: f6870bd48c1ab5522d8d71cd58e8a2ed061a6a93 (plain) (blame)
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
{ lib
, buildPythonPackage
, fetchFromGitHub
, beautifulsoup4
, pythonOlder
, pandas
, python
, numpy
, scikit-learn
, scipy
, lxml
, matplotlib
, sarge
}:

buildPythonPackage rec {
  pname = "trectools";
  version = "0.0.49";
  format = "setuptools";

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "joaopalotti";
    repo = pname;
    # https://github.com/joaopalotti/trectools/issues/41
    rev = "5c1d56e9cf955f45b5a1780ee6a82744d31e7a79";
    hash = "sha256-Lh6sK2rxEdCsOUKHn1jgm+rsn8FK1f2po0UuZfZajBA=";
  };

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

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

  checkPhase = ''
    cd unittests
    ${python.interpreter} -m unittest runner
  '';

  pythonImportsCheck = [ "trectools" ];

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