From bcfdde613d86e5295ae7b95fe9ebcd5edaa1b018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 5 Jul 2022 16:02:13 +0200 Subject: [PATCH] python3Packages.trectools: init at 0.0.49 Co-authored-by: Sandro --- .../python-modules/trectools/default.nix | 59 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 61 insertions(+) create mode 100644 pkgs/development/python-modules/trectools/default.nix diff --git a/pkgs/development/python-modules/trectools/default.nix b/pkgs/development/python-modules/trectools/default.nix new file mode 100644 index 000000000000..1c3b2a542bc3 --- /dev/null +++ b/pkgs/development/python-modules/trectools/default.nix @@ -0,0 +1,59 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, beautifulsoup4 +, pythonOlder +, pandas +, python +, numpy +, scikit-learn +, scipy +, lxml +, matplotlib +, sarge +}: + +buildPythonPackage rec { + pname = "trectools"; + version = "0.0.49"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "joaopalotti"; + repo = pname; + # https://github.com/joaopalotti/trectools/issues/41 + rev = "5c1d56e9cf955f45b5a1780ee6a82744d31e7a79"; + sha256 = "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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2a95daf3a550..9baa9a4b6877 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10420,6 +10420,8 @@ in { transmissionrpc = callPackage ../development/python-modules/transmissionrpc { }; + trectools = callPackage ../development/python-modules/trectools { }; + treelog = callPackage ../development/python-modules/treelog { }; treeo = callPackage ../development/python-modules/treeo { };