depot/third_party/nixpkgs/pkgs/development/python-modules/rank-bm25/default.nix
Default email 2c76a4cb41 Project import generated by Copybara.
GitOrigin-RevId: c757e9bd77b16ca2e03c89bf8bc9ecb28e0c06ad
2023-11-16 04:20:00 +00:00

43 lines
979 B
Nix

{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, numpy
}:
let
pname = "rank-bm25";
version = "0.2.2";
in
buildPythonPackage {
inherit version pname;
format = "setuptools";
# Pypi source package doesn't contain tests
src = fetchFromGitHub {
owner = "dorianbrown";
repo = pname;
rev = version;
hash = "sha256-+BxQBflMm2AvCLAFFj52Jpkqn+KErwYXU1wztintgOg=";
};
disabled = pythonOlder "3.7";
postPatch = ''
# Upstream doesn't provide a PKG-INFO file
substituteInPlace setup.py --replace "get_version()" "'${version}'"
'';
propagatedBuildInputs = [
numpy
];
pythonImportsCheck = [ "rank_bm25" ];
meta = with lib; {
description = "A Collection of BM25 Algorithms in Python";
homepage = "https://github.com/dorianbrown/rank_bm25";
changelog = "https://github.com/dorianbrown/rank_bm25/releases/tag/${version}";
license = licenses.asl20;
maintainers = with maintainers; [ happysalada ];
};
}