Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / rank-bm25 / default.nix
blob9b0c5080449d139653f9c03b88acaed56063fe5f
1 { lib
2 , buildPythonPackage
3 , pythonOlder
4 , fetchFromGitHub
5 , numpy
6 }:
7 let
8   pname = "rank-bm25";
9   version = "0.2.2";
11 buildPythonPackage {
12   inherit version pname;
13   format = "setuptools";
15   # Pypi source package doesn't contain tests
16   src = fetchFromGitHub {
17     owner = "dorianbrown";
18     repo = pname;
19     rev = version;
20     hash = "sha256-+BxQBflMm2AvCLAFFj52Jpkqn+KErwYXU1wztintgOg=";
21   };
23   disabled = pythonOlder "3.7";
25   postPatch = ''
26     # Upstream doesn't provide a PKG-INFO file
27     substituteInPlace setup.py --replace "get_version()" "'${version}'"
28   '';
30   propagatedBuildInputs = [
31     numpy
32   ];
34   pythonImportsCheck = [ "rank_bm25" ];
36   meta = with lib; {
37     description = "A Collection of BM25 Algorithms in Python";
38     homepage = "https://github.com/dorianbrown/rank_bm25";
39     changelog = "https://github.com/dorianbrown/rank_bm25/releases/tag/${version}";
40     license = licenses.asl20;
41     maintainers = with maintainers; [ happysalada ];
42   };