1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, beautifulsoup4
5, pythonOlder
6, pandas
7, python
8, numpy
9, scikit-learn
10, scipy
11, lxml
12, matplotlib
13, sarge
14}:
15
16buildPythonPackage rec {
17 pname = "trectools";
18 version = "0.0.49";
19
20 disabled = pythonOlder "3.6";
21
22 src = fetchFromGitHub {
23 owner = "joaopalotti";
24 repo = pname;
25 # https://github.com/joaopalotti/trectools/issues/41
26 rev = "5c1d56e9cf955f45b5a1780ee6a82744d31e7a79";
27 sha256 = "sha256-Lh6sK2rxEdCsOUKHn1jgm+rsn8FK1f2po0UuZfZajBA=";
28 };
29
30 postPatch = ''
31 substituteInPlace setup.py \
32 --replace "bs4 >= 0.0.0.1" "beautifulsoup4 >= 4.11.1"
33 '';
34
35 propagatedBuildInputs = [
36 pandas
37 numpy
38 scikit-learn
39 scipy
40 lxml
41 beautifulsoup4
42 matplotlib
43 sarge
44 ];
45
46 checkPhase = ''
47 cd unittests
48 ${python.interpreter} -m unittest runner
49 '';
50
51 pythonImportsCheck = [ "trectools" ];
52
53 meta = with lib; {
54 homepage = "https://github.com/joaopalotti/trectools";
55 description = "Library for assisting Information Retrieval (IR) practitioners with TREC-like campaigns";
56 license = licenses.bsdOriginal;
57 maintainers = with maintainers; [ MoritzBoehme ];
58 };
59}