1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5 rustPlatform,
6 cargo,
7 rustc,
8 unittestCheckHook,
9}:
10
11buildPythonPackage rec {
12 pname = "gb-io";
13 version = "0.3.6";
14 pyproject = true;
15
16 src = fetchFromGitHub {
17 owner = "althonos";
18 repo = "gb-io.py";
19 rev = "v${version}";
20 hash = "sha256-iLRXyiVji9q4C5YtBsTT9bklSueY9RlX7Kz4cu+hmpE=";
21 };
22
23 cargoDeps = rustPlatform.fetchCargoVendor {
24 inherit
25 pname
26 version
27 src
28 sourceRoot
29 ;
30 hash = "sha256-miwCgZpaFVMaNJLUTYSGEkmg+uT7lbzJZnBa9yZqC8U=";
31 };
32
33 sourceRoot = src.name;
34
35 nativeBuildInputs = [
36 cargo
37 rustc
38 rustPlatform.cargoSetupHook
39 ];
40
41 build-system = [ rustPlatform.maturinBuildHook ];
42
43 nativeCheckInputs = [ unittestCheckHook ];
44
45 pythonImportsCheck = [ "gb_io" ];
46
47 meta = with lib; {
48 homepage = "https://github.com/althonos/gb-io.py";
49 description = "Python interface to gb-io, a fast GenBank parser written in Rust";
50 license = licenses.mit;
51 maintainers = with lib.maintainers; [ dlesl ];
52 };
53}