1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 rustPlatform,
6
7 # build-system
8 cargo,
9 rustc,
10}:
11
12buildPythonPackage rec {
13 pname = "py-rust-stemmers";
14 version = "0.1.5";
15 pyproject = true;
16
17 src = fetchFromGitHub {
18 owner = "qdrant";
19 repo = "py-rust-stemmers";
20 tag = "v${version}";
21 hash = "sha256-WpTbS8XoOKhyyt1/YGagulopFKiqNI0ETkhjpiX0TL8=";
22 };
23
24 cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; };
25
26 postPatch = ''
27 ln -s ${./Cargo.lock} Cargo.lock
28 '';
29
30 build-system = [
31 cargo
32 rustPlatform.cargoSetupHook
33 rustPlatform.maturinBuildHook
34 rustc
35 ];
36
37 pythonImportsCheck = [ "py_rust_stemmers" ];
38
39 meta = {
40 description = "High-performance Python wrapper around the rust-stemmers library, utilizing the Snowball stemming algorithm";
41 homepage = "https://github.com/qdrant/py-rust-stemmers";
42 license = lib.licenses.mit;
43 maintainers = with lib.maintainers; [ GaetanLepage ];
44 };
45}